Trinthlo

Getting Values From Form Elements Using Prototype

Retrieving a value for a radio field:

try {
   val = Form.getInputs('form_name', 'radio', 'group_name').find(function(radio) { return radio.checked; }).value;
} catch(e) { val = ''; }
Retrieving all values from a group of checkboxes:

Form.getInputs('form_name', 'checkbox', 'group_name').each(function(e) {
    if ($(item).checked) {
        v = (v == '') ? $(item).value : v + ', ' + $(item).value;
        t = t + 7;
    }
});