Groups | Blog | Home
all groups > c# > june 2005 >

c# : Regarding RadioButtonList Control



Suresh.P.R
6/28/2005 10:12:01 PM
Hi,

While using the RadioButtonList control, that I populated in the runtime, I
am not able to get the selected item in the javascript while referring

document.Form.RadioButtonList.value.

What is the solution.
The DropDownList control is able to refer in javascript like
document.Form.DropDownList.value

Please instruct me.
=====================Suresh

Sameer Chandargi
6/29/2005 6:29:04 AM
Hi,

please use following javascript to get selected radio button value
function GetSelectedRadioOption(rbList)
{
var iIndex=0;
while(document.getElementById(rbList + '_' + iIndex))
{
if (document.getElementById(rbList + '_' + iIndex).checked)
{
var selected = document.getElementById(rbList + '_' + iIndex).value;
return selected;
}
iIndex=iIndex+1;
}
}


[quoted text, click to view]
Suresh.P.R
6/29/2005 8:03:15 AM
Hi Sameer Chandargi,

It is working fine. Thanks.

======================Suresh.P.R

[quoted text, click to view]
AddThis Social Bookmark Button