Sunday 15 August 2010

asp.net - java script for radiobuttonlist select and deselect -


I have radio button list control in which the data is coming from DB and is bidding in a .cs file

Now I have to write a Javascript that if the user selects item 1 in the Radiobutton list, then it is selected and then the user clicks on a single item then deselect it.

Even if I have 10 items, then this should be selected and deselecting the item's churn on it

thanks

  & lt; Input type = "radio" name = "foo" value = "bar" onclick = "toggle (this);" & Gt; Var radio = new array; Function toggle (radio) {if (radios [radio.name] == radio.value) {radio.checked = false; } Other {radio.checked = true; Radio [radio.name] = radio.value; }}  

No comments:

Post a Comment