Click here to Skip to main content
15,918,178 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi
I am on page test1.aspx , where i have radio button, and input type button ,

when i click radio button,i set value to input type button...and on button click, i goto test2.aspx,,,,then when i click browser back button , the radio button is selected,

I want to make all radio buttons as unselected when i go to back page from browser
Posted

1 solution

try this js function:-
C#
function uncheckAll()
{
allChk = document.getElementByType("radio");
     for (i = 0; i < allChk.length; i++)
        {
        document.Form1.allChk[i].checked = false;
        }
}

or
C#
function uncheckAll()
{
allInp = document.getElementByTagName("input");
for (i = 0; i < allInp.length; i++)
{
  if (allInp[i].type == "radio")
  {
    allInp[i].checked = false;
  }
}
}

or js function like:-
C#
$("input:radio[name='thename']").each(function(i) {
       this.checked = false;
});
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900