Jump to content

Set Values of UnChecked CheckBoxes


ShoeLace1291

Recommended Posts

jQuery is a library created by someone, you need to get the jQuery js file

 

but you can do it without jQuery, and probably with the same amount of code :)

 

 

Edit: Well, probably a couple lines more, but thats not the reason for my edit.. Thorpe's example (which is probably the only way to do it anyway.. minus the jquery) would set checked attribute to true, which will literally tick the checkbox you'd want to ALSO set the value of the checkbox to 0.. just a sidenote

you'd want to ALSO set the value of the checkbox to 0

 

Which is what this bit....

 

$this.val(0)

 

does.

 

wow jquery does it all huh.. so val() actually returns the updated element after the value change?

 

I personally never used jQuery :)

jQuery is a library created by someone, you need to get the jQuery js file

 

but you can do it without jQuery, and probably with the same amount of code :)

 

 

Edit: Well, probably a couple lines more, but thats not the reason for my edit.. Thorpe's example (which is probably the only way to do it anyway.. minus the jquery) would set checked attribute to true, which will literally tick the checkbox you'd want to ALSO set the value of the checkbox to 0.. just a sidenote

jQuery is a library created by someone, you need to get the jQuery js file

 

but you can do it without jQuery, and probably with the same amount of code :)

 

 

Edit: Well, probably a couple lines more, but thats not the reason for my edit.. Thorpe's example (which is probably the only way to do it anyway.. minus the jquery) would set checked attribute to true, which will literally tick the checkbox you'd want to ALSO set the value of the checkbox to 0.. just a sidenote

 

ily man

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.