| 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: 15357
|
|
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: 15357
|
|
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: 56200
|
|
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 ]
|
[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About 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.
|
 |
 |
|
|
subject: problem with unchecking checkbox
|
|
|