Quintin79
asked on
Radiobuttonlist client side javascript question
OK
in HTML if i want to find the length or loop through an array of radio buttons in the browser i can usually go document.getElementById("a rrayName") .length; cant I?
when you create a radiobuttonlist in asp.net it creates the correct radio tags on client side but it also surrounds them in a table with the same name. you know that by naming the radios all the same it creates an array of the radios but asp.net throws in a table of the same name and i cant seem to access the radio buttons.
when i go document.getElementById("a rrayName") it returns the table and therefore i cant get the radios.
any ideas on how to sort this one out
thanks in advance
in HTML if i want to find the length or loop through an array of radio buttons in the browser i can usually go document.getElementById("a
when you create a radiobuttonlist in asp.net it creates the correct radio tags on client side but it also surrounds them in a table with the same name. you know that by naming the radios all the same it creates an array of the radios but asp.net throws in a table of the same name and i cant seem to access the radio buttons.
when i go document.getElementById("a
any ideas on how to sort this one out
thanks in advance
ASKER
yes i know this and its the very last option. the reason is that in most cases the radiobutton list will be of any size it wants so i wont know how many rb objects i have to loop through.
Instead of
document.getElementById("a rrayName")
have you tried
document.forms[0].arrayNam e
? (Might need to check the client-side View Source to verify the common radio button name -- that's name, not ID -- for this.)
document.getElementById("a
have you tried
document.forms[0].arrayNam
? (Might need to check the client-side View Source to verify the common radio button name -- that's name, not ID -- for this.)
I do not understand your question. What do you want to achieve? Length of the radio buttonlist, you mean how many radio buttons in the list?
ASKER
ryerras - yes. that way i can loop thru it in javascript.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
oh man is that all i can do ? thats a let down. anyway thanks - your answer is the go.
So to access the first radio button, you should use document.getElementById("a