I think this might work.  You could wrap it up into a function, of course,
with name as a parameter.

 

 
$$('input[type="radio"][name="whatever"]').find(function(radio)
               { return radio.checked; }).value;

 

--
Jonathan Rosenberg
Founder & Executive Director, Tabby's Place
http://www.tabbysplace.org/

 

 

From: prototype-scriptaculous@googlegroups.com
[mailto:prototype-scriptacul...@googlegroups.com] On Behalf Of Shane
McCarron
Sent: Friday, April 30, 2010 1:32 PM
To: prototype-scriptaculous@googlegroups.com
Subject: [Proto-Scripty] Getting the value of a form field

 

I am sure this is just ignorance on my part, but...

I would really like to $F('formField') to get the value of whatever field I
am interested in.  However, it seems formField needs to be the field's ID,
not its Name.  That's cool, except when I have Radio Buttons or Check Boxes.
You aren't allowed to have multiple elements with the same ID and still be
valid.  What's the right way to do this?


-- 
Shane McCarron
halindr...@gmail.com

-- 
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-scriptacul...@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.

-- 
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-scriptacul...@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