I am hoping someone will correct me, that said I have spent a little
time looking at this now. 2hours infact.
Prototype doesnt support getValue for input radio.
The work around to equal getValue().[1]
/**
* Returns the value of the selected radio button in the radio group, null if
* none are selected, and false if the button group doesn't exist
*
* @param {radio Object} or {radio id} el
* OR
* @param {form Object} or {form id} el
* @param {radio group name} radioGroup
*/
function $RF(el, radioGroup) {
if($(el).type && $(el).type.toLowerCase() == 'radio') {
var radioGroup = $(el).name;
var el = $(el).form;
} else if ($(el).tagName.toLowerCase() != 'form') {
return false;
}
var checked = $(el).getInputs('radio', radioGroup).find(
function(re) {return re.checked;}
);
return (checked) ? $F(checked) : null;
}
To use it:
$RF( 'wdt-form-test', 'abc' );
This is the same as using $( input ).getValue() for other input fields.
$RF('wdt-form-test','abc ) = $(input).getValue();
[1]http://xavisys.com/2007/03/using-prototype-javascript-to-get-the-value-of-a-radio-group/
--~--~---------~--~----~------------~-------~--~----~
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 [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---