| Author |
Question on dynamically generated radio buttons
|
Saathvik Reddy
Ranch Hand
Joined: Jun 03, 2005
Posts: 228
|
|
Hi, I have a JSP page which generates the name of the radio button dynamically. My code in JSP: <html:radio property = '<%=question.getOid()%>' value = "<%=qvalue.getOid()%>" onklick="showRadioLayer(this)"/> This JSP code generates 2 radio buttons with the same name(radio group) but with different values. My code in Java Script: function showRadioLayer(id){ var a = id.name; // I can get the name of the radio button with this var len = document.form.a.length //I want to get length of radio group but i cant get the length. I know this is wrong but how do i get the length of the radio group. Please help me, Thanks
|
 |
Eric Pascarello
author
Rancher
Joined: Nov 08, 2001
Posts: 15362
|
|
because you are not referecing it right... var len = document.form.elements[a].length; Eric
|
 |
Saathvik Reddy
Ranch Hand
Joined: Jun 03, 2005
Posts: 228
|
|
|
Thanks a lot!!!
|
 |
 |
|
|
subject: Question on dynamically generated radio buttons
|
|
|