joe t. wrote:
> i agree on that. setValue has its purpose pretty much in the name.
> "Set" the "value" of a control. For checkboxes, "setChecked
> (bool)" (also applying to radios?) would have made a lot more sense.
> 

Yes, it does apply to radios to. It's a shame that the docs aren't 
clear on this behavior.

You can play a little with this test page:
http://tsalarioth.art.pl/~sw/setValueTest.html

I personally think it would be better if setValue on radio and 
checkbox either really set the value, or set the checked state base on 
comparison:

Element.setValue = function(element, newValue) {
     $(element).checked = ($(element).value == newValue);
}

This way, you could check or uncheck the element, especially radio, 
based on that if value is matching. This would be useful for methods 
similar to Form.unserialize();

It is of course impossible to be done at this state of the library, 
where the code is used in (hundreds of) thousands of scripts among the 
web.

I will probably write additional method for my needs with use of the 
excellent Element.extend method.

Anyway,
I want to thank all the prototype.js developers, doc writers and 
supporters for your work on the library. Great job!

Best regards,
SWilk

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to