Faust
2005-Aug-19 13:40 UTC
[Rails-spinoffs] Form.Element.getValue for checkboxes and radios?
I notice that Form.Element.getValue() takes a single element or id and returns the element name and value. How does one handle getting the values of checkboxes and/or radios which share the same control name, save getting them one at a time? <fieldset> <legend>Medical History</legend> <input name="history_illness" type="checkbox" value="Smallpox" /> Smallpox <input name="history_illness" type="checkbox" value="Mumps" /> Mumps <input name="history_illness" type="checkbox" value="Dizziness" /> Dizziness <input name="history_illness" type="checkbox" value="Sneezing" /> Sneezing </fieldset> Is there already an easy way to do something like Form.Element.getValueByName(''history_illness'') built into Prototype or is that left as an exercise for the reader (me)? Thanks in advance, Faust