This week's book giveaway is in the Jython/Python forum.
We're giving away four copies of Murach's Python Programming and have Michael Urban and Joel Murach on-line!
See this thread for details.



Only 44 hours left in the trailboss' kickstarter!

New rewards and stretch goals. CLICK HERE!



Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

javascript validation in jsf  RSS feed

 
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!
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!