0

I have radiobuttonlist in which there is 3 items.
I have checkboxlist in which there is 5 items.
I have a button.
I want to unselect all the selected check boxes in the list when the button is clicked.
And I want to unselect the selected radiobutton in the radiobuttonlist.
How can I do this in JS
Pls help..

Edited by subhankar02dey: n/a

4
Contributors
7
Replies
8
Views
7 Years
Discussion Span
Last Post by Airshow
0

Your HTML button would look like this:

<input type="button" value='Uncheck' onClick="uncheck()" />

At the top of your HTML in the head section place the following code:

<SCRIPT LANGUAGE="JavaScript">
function uncheck() {
  document.myform.box1.checked = false;
  document.myform.box2.checked = false;
  document.myform.box3.checked = false;
  document.myform.box4.checked = false;
}
</script>

Make sure you substitute your check box names for box1,box2,...

If they are all the same name here is another technique for setting and unsetting all of them: Check box example

You should also look into the jQuery library.

0

I am not talking about checkboxes, I am talking about a checkboxlist.
There is no box names under the checkboxlist,
only the boxes are added like listitems and they dont hv any names

ALso, I am talking about a radiobuttonlist, how to write code in JS such that when the button is clicked, the selected radiobutton in the radiobuttonlist will be unselected

0

If I Google "checkboxlist", all the top results refer to ASP.NET.

If this is not an ASP.NET related question, then you need to explain what you mean by the term.

Airshow

0

i assume this is an interview question

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.