• Post Reply Bookmark Topic Watch Topic
  • New Topic

Button action depending on checkbox selection.

 
Robert James Liguori
Author
Ranch Hand
Posts: 562
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;
}
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!