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

checkbox activated deactivated  RSS feed

 
Isaac Ferguson
Ranch Hand
Posts: 1054
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: 10878
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: 65826
134
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.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!