• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

problem with unchecking checkbox

 
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
you setting it in the html code or with JavaScript?

When is it not unchecking?

Eric
 
raja reddy
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am using checkbox in HTML
 
Eric Pascarello
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Sheriff
Posts: 67752
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ]
 
Ranch Hand
Posts: 230
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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'm just a poor boy, I need no sympathy, because I'm easy come, easy go, little high, little low, little ad
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic