wood burning stoves 2.0*
The moose likes HTML, CSS and JavaScript and the fly likes problem with unchecking checkbox 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 "problem with unchecking checkbox" Watch "problem with unchecking checkbox" New topic
Author

problem with unchecking checkbox

raja reddy
Greenhorn

Joined: Aug 12, 2008
Posts: 16
When I am trying to checkbox using checked="yes" ,checked="true".Its working.
But I am unchecking using checked="no" ,checked="false" ,the checkbox is not unchecking.

can anybody help?
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
you setting it in the html code or with JavaScript?

When is it not unchecking?

Eric
raja reddy
Greenhorn

Joined: Aug 12, 2008
Posts: 16
I am using checkbox in HTML
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
To make it unchecked, you do not have to specify anything. The default is unchecked.

If it is happening on page refresh, you would have to code some JavaScript to reset the checkboxes on the page load.

Eric
raja reddy
Greenhorn

Joined: Aug 12, 2008
Posts: 16
I am using checkbox in HTML.When I am unchecking checkbox in html using

its not unchecking.

what are the values i can use for checking and unchecking checkbox.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60780
    
  65

Here it is one more time: if the checked attribute appears, the checkbox will be checked. It doesn't matter what you set the value to.
[ November 14, 2008: Message edited by: Bear Bibeault ]

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Paul Yule
Ranch Hand

Joined: May 12, 2008
Posts: 229
In fact you don't even need a value for the "checked" attribute.

<input type="checkBox" checked/>

works just fine. If it isn't checked it will be sent as null so you can just check if the parameter is null. In my experience the value attribute for a checkBox--more often that not-- is superfluous. If other data is needed to be sent with the specific checkBox you bind a js function to the onClick of the checkBox and pass the HTML object to the function.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: problem with unchecking checkbox
 
Similar Threads
Retaining checked value in selectBooleanCheckbox on enabling
HTTPUnit and Checkboxes
Friggin' checkboxes
Problem with selected checkbox value in struts 1.2
checkboxes from a query , How to ?????