aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes checkbox activated deactivated Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "checkbox activated deactivated" Watch "checkbox activated deactivated" New topic
Author

checkbox activated deactivated

Isaac Ferguson
Ranch Hand

Joined: Jun 22, 2012
Posts: 391
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
Bartender

Joined: Feb 26, 2001
Posts: 5019
    
    8

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)



Junilu - [How to Ask Questions] [How to Answer Questions]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61661
    
  67

The value of the checkbox will only be submitted when it is checked. If unchecked, no value will be submitted.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
 
subject: checkbox activated deactivated