Velocityman
Programmer
Using VWD 2008, (I know there are newer versions), here is the what a want to accomplish. A button that will uncheck a radiobuttonlist with only one item. All I want to accomplish in javascript. Since there is only one item in list, is there a one line of code to complete this? This should not be that difficult. What am I missing in the javascript code and/or event within the button. Any assistance would be greatly appreciated. I do not want to change the control by the way.
Thanks!
button:
<asp:Button ID="Button1" runat="server" OnClientClick="ClearMedicaidButton()" style="margin-left: 0px" Text="Clear Selection (Medicaid)" UseSubmitBehavior="False" />
Javascript:
function ClearMedicaidButton()
{
var rgrp = document.getElementsByName('RadioButtonList6');
rgrp[0].selected = false;
rgrp[0].checked = false;
}
RadioButtonList:
<asp:RadioButtonList ID="RadioButtonList6" runat="server"
TabIndex="69" Width="300" style="margin-left: 6px">
<asp:ListItem Value="Medicaid (Medical Assistance Program)">
Medicaid (Medical Assistance Program)
</asp:ListItem>
</asp:RadioButtonList>
Thanks!
button:
<asp:Button ID="Button1" runat="server" OnClientClick="ClearMedicaidButton()" style="margin-left: 0px" Text="Clear Selection (Medicaid)" UseSubmitBehavior="False" />
Javascript:
function ClearMedicaidButton()
{
var rgrp = document.getElementsByName('RadioButtonList6');
rgrp[0].selected = false;
rgrp[0].checked = false;
}
RadioButtonList:
<asp:RadioButtonList ID="RadioButtonList6" runat="server"
TabIndex="69" Width="300" style="margin-left: 6px">
<asp:ListItem Value="Medicaid (Medical Assistance Program)">
Medicaid (Medical Assistance Program)
</asp:ListItem>
</asp:RadioButtonList>