• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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: 67749
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.
 
You ought to ventilate your mind and let the cobwebs out of it. Use this cup to catch the tiny ads:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic