Hi
i have one RadioButtonList as below...
<asp:RadioButtonList id="rblType" runat="server"
style="z-index: 103; left: 465px; position: absolute; top: 120px;
width: 150px; height: 16px; vertical-align: middle;"
RepeatDirection="Horizontal" AutoPostBack="false"
onmousedown
="getCheckedRadio()"
OnSelectedIndexChanged="rblType_SelectedIndexChanged">
<asp:ListItem Text="St" Value="St" Selected="True"></asp:ListItem>
<asp:ListItem Text="TC" Value="TC"></asp:ListItem>
</asp:RadioButtonList>
now i want to change the text of textbox using the selected lsititem in radiobuttonlist using javascript.
function getCheckedRadio()
{
var rblType= document.getElementsByName("ctl00_messagePanelsContent_contentPlaceHolder_fvAllotmentDetail_rblType");
//some loop here on rblType and then
for(int i=0; i < rblType.length; i++ )
{
if (rblType.item[i] == "checked")
{
alert("You checked ");
}
}
}
but the above javascript code is not working.
could anyone please help me to how to get the selected listitem using javascript.
thanks in advance...
waiting for reply.