• Post Reply Bookmark Topic Watch Topic
  • New Topic

checkbox activated deactivated  RSS feed

 
Isaac Ferguson
Ranch Hand
Posts: 1063
3
Java Netbeans IDE Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

I am retrieving from my servlet always true using the code



My html code is



But i want retrieve true only if the checkbox is pressed. Any idea?

Thanks
 
Junilu Lacar
Sheriff
Posts: 10950
158
Android Debian Eclipse IDE IntelliJ IDE Java Linux Mac Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are using the wrong attribute. Use checked="checked" in your markup to make it checked when the page is loaded. The value attribute is used to differentiate the checkbox from other checkboxes in the same group (that is, a group of checkboxes would have the same 'name' attribute but each checkbox would have a unique 'value' to differentiate it from others)

 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66154
146
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The value of the checkbox will only be submitted when it is checked. If unchecked, no value will be submitted.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!