I'm attempting to intercept the click event for RadioButons in an attempt to ask the user for confirmation of their action.
I determined that Internet Explorer does not reset the previous selection if the user was to cancel the action.
In order to reset the previous select (cancel the new selection) I have to save a reference to the original selected radio button....well actually right now I'm just attempting to save the ID of the original radio button.
Anyways, my problem isn't entirely related to this.
My problem is that I'm trying to intercept the click event for an ASP.NET RadioButtonList control.
My server code provides the client ID of the RadioButtonList control so that my JavaScript control can apply itself to the associated controls.
Apparently the ASP.NET RadioButtonList renders as an HTML Table element with rows of radio buttons:
So instead of using the $get() method (the document.getEle mentByID method) I tried using the document.getEle mentsByName() method when I discover that the element doesn't have a type.
The problem is that the getElementsByNa me method is only returning the Table and not the RadioButtons.
Is there something else that I can use to retrieve the RadioButtons so that I don't have to loop through the table cells?
I determined that Internet Explorer does not reset the previous selection if the user was to cancel the action.
In order to reset the previous select (cancel the new selection) I have to save a reference to the original selected radio button....well actually right now I'm just attempting to save the ID of the original radio button.
Anyways, my problem isn't entirely related to this.
My problem is that I'm trying to intercept the click event for an ASP.NET RadioButtonList control.
My server code provides the client ID of the RadioButtonList control so that my JavaScript control can apply itself to the associated controls.
Apparently the ASP.NET RadioButtonList renders as an HTML Table element with rows of radio buttons:
Code:
<table id="RadioButtonList1" border="0"> <tr> <td><input id="RadioButtonList1_0" type="radio" name="RadioButtonList1" value="1" /><label for="RadioButtonList1_0">1</label></td> </tr><tr> <td><input id="RadioButtonList1_1" type="radio" name="RadioButtonList1" value="2" checked="checked" /><label for="RadioButtonList1_1">2</label></td> </tr><tr> <td><input id="RadioButtonList1_2" type="radio" name="RadioButtonList1" value="3" /><label for="RadioButtonList1_2">3</label></td> </tr> </table>
The problem is that the getElementsByNa me method is only returning the Table and not the RadioButtons.
Is there something else that I can use to retrieve the RadioButtons so that I don't have to loop through the table cells?
Comment