Thursday, February 21, 2008

RadioButtonList Selected Value

David Seruyange blogged about how to get the selected value of the radiobuttonlist through javascript which is a very useful tip:

<script type="text/javascript">

function getRadioSelectedValue(radioList)

{

var options = radioList.getElementsByTagName('input');

for(i=0;i<options.length;i++)

{

var opt = options[i];

if (opt.checked)

{

return opt.value;

}

}

}

</script>


radioList is the clientid of the radiobuttonlist.

RadioButtonList Javascript Accessible
blog comments powered by Disqus