A checkbox or a radiobox value is commonly used to determine if a value
should be stored or not, therefore the value of a check/radio box is
static and has nothing to do with the state of the checkbox.
This is just to clarify what the common understanding is . I like to
know the reason behind what people do too so that's why i'm sending this.
Dylan Verheul schreef:
> OK, I'll do it like that then. Thanks for the response.
>
> On 9/5/06, John Resig <[EMAIL PROTECTED]> wrote:
>
>> That's not my understanding as to how checkbox values work. If you
>> really want to uncheck a checkbox, you have to remove the checked
>> attribute - changing the value does /not/ have the same effect.
>>
>> So, to uncheck it you could do:
>> $("#foo").removeAttr("checked");
>>
>> --John
>>
>> On 9/5/06, Dylan Verheul <[EMAIL PROTECTED]> wrote:
>>
>>> I have a checkbox like this
>>>
>>> <input type="checkbox" id="foo" value="1" checked="checked" />
>>>
>>> I would expect this code to uncheck it:
>>> $("#foo").val(0); // any value != 1 should uncheck it
>>> and this code to check it
>>> $("#foo").val(1);
>>>
>>> It doesn't.
>>>
>>> The value attribute of a checkbox is imho not dynamic like a texbox's,
>>> but static, and can only be toggled to on or off.
>>>
>>> When manipulating form fields (don't get me started on radio button
>>> sets), jQuery seems to lose its beauty.
>>>
>>> Any ideas?
>>>
>>> ____
>
--
David Duymelinck
________________
[EMAIL PROTECTED]
_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/