Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa Struts multiboxes
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


rahul
multiboxes
1 Answer(s)      6 years ago
Posted in : Struts



Advertisement
View Answers

December 6, 2008 at 3:19 AM


Hi friend,

Code to solve the problem :


<HTML>
<HEAD>
<TITLE>Check/Uncheck All Checkbox</TITLE>

<SCRIPT LANGUAGE="JavaScript">

<!-- Begin
function checkAll(field)
{
for (i = 0; i < field.length; i++)
field[i].checked = true ;
}

function uncheckAll(field)
{
for (i = 0; i < field.length; i++)
field[i].checked = false ;
}

</script>

</HEAD>

<BODY>
<form name="myform" action="checkboxes.asp" method="post">
<b>Your Favorite Scripts & Languages</b><br>
<input type="checkbox" name="list" value="1">Java<br>
<input type="checkbox" name="list" value="2">Javascript<br>
<input type="checkbox" name="list" value="3">Active Server Pages<br>
<input type="checkbox" name="list" value="4">HTML<br>
<input type="checkbox" name="list" value="5">SQL<br>

<input type="radio" name="radioCheck" value="Check All"
onClick="checkAll(document.myform.list)">Check All
<input type="radio" name="radioCheck" value="Uncheck All"
onClick="uncheckAll(document.myform.list)">Uncheck All
<br>
</form>

</BODY>
</HTML>


Thanks


Related Tutorials/Questions & Answers:
multiboxes - Struts
multiboxes  I have a program that has an array of multiboxes and 2 radio buttons(checkall & uncheckall)... When i check 'checkall' all checkboxes are checked but when i click on uncheck it does nothing(The uncheck radio button
Advertisements
 

 

 

DMCA.com