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

Button action depending on checkbox selection.  RSS feed

 
Robert James Liguori
Author
Ranch Hand
Posts: 583
6
Java Netbeans IDE Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If a checkbox is not checked in JSF, I wish to open up a javascript warning when the commandButton is pressed.

How do I do this?
 
Karanjit Singh
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just use normal javascript to do this as follows:

if(!document.getElementById(idOfCheckBox).checked)
{
alert('Check Box Not Selected');
return false;
}
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!