|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
How do I get the SelectedValue from a RadioButtonList using javascriptCan anyone tell me how to get the SelectedValue from a ASP.net
RadioButtonList, using javavscript. Here is my code: <ASP:RADIOBUTTONLIST id="optOption" runat="server" ONCLICK="javascript:alert(document.all.optOption.selectedItem);"></ASP:RADIOBUTTONLIST> This is not working. I am getting an error saying that 'document.all.optOption.selectedItem is null or not an object'. Thanks in advance, Pierre Hi,
Please remove inline javascript code. <ASP:RADIOBUTTONLIST id="optOption" runat="server"></ASP:RADIOBUTTONLIST> Add the following code in the code behind file. Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load 'Put user code to initialize the page here optOption.Attributes.Add("OnClick", "alert(" & optOption.ClientID.ToString & ".value)") End Sub Regards, nandha. >-----Original Message----- ment.all.optOption.selectedItem);"></ASP:RADIOBUTTONLIST>>Can anyone tell me how to get the SelectedValue from a ASP.net >RadioButtonList, using javavscript. > >Here is my code: > ><ASP:RADIOBUTTONLIST id="optOption" runat="server" >ONCLICK="javascript:alert(docu Show quoteHide quote > > >This is not working. I am getting an error saying that >'document.all.optOption.selectedItem is null or not an object'. > >Thanks in advance, >Pierre > >. >
Checkbox in a datagrid always returns false
hosting app from pc Highlight the datalist row adding a new row to the repeater control Div tag to display/ hide a control ....please help Chart position RadioBNuttonList Problem query database, create control, display on page Trouble Filling DropDownList in Datagrid Compatibility problem of IEWebConrols |
|||||||||||||||||||||||