• Post Reply Bookmark Topic Watch Topic
  • New Topic

javascript validation in jsf

 
Dhaval Shah
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
can we use javascript in jsf for validations. If yes can you please explain with an example

Regards,
Dhaval Shah
 
Bauke Scholtz
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, you can. You can use the onclick attribute of the UICommand tag for example. If the validation fails, then return false, then the UICommand Action Event won't be invoked. If return true, then the UICommand ActionEvent will be invoked.
 
Dhaval Shah
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks, Bauke Scholtz
for your immediate reply

Regards,
Dhaval Shah
 
Eugene Babiev
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you can download from corejsf.com the sample code and take the commons-validation jar with examples of how to use it. Works great!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!