Jump to content
Killersites Forums

check all checkbox


Recommended Posts

hello everybody...

facing a simple problem.what is the format to make all check-boxes check in particular category..

i have 3-4 categories in my code.n i have created a function check all which will select all check-boxes.bt the problem is that i want to create three separate functions for each category which can select only check boxes belonging to that category...

what is the format in js..

here is part of my code

 

// function check all which select all checkboxes

function chkall()

{

for(i=0; i<document.selectlist.elements.length; i++)

{

if (document.selectlist.elements.checked==false)

{

document.selectlist.elements.checked=true;

}

}

 

 

 

//php n html coding

 

 

<form name="selectlist" action="calledlistpg.php?requestid=<? echo $requestid?>&clientid=<? echo $clientid ?>&page=<? echo $page ?>" method="post">

 

 

echo"<td><input type='checkbox' name='chkselectmodel[]' value='$regid'></td>";

echo "<td><input type='checkbox' name='chkselectmodelpics[]' value='$regid'></td>";

echo "<td><input type='checkbox' name='chkselectmodelmsg[]' value='$regid'></td>";

echo "<td><input type='checkbox' name='chkselectmodelng[]' value='$regid'></td>";

 

 

//cz of checkall function all checkboxes are getting selected...i want to create 3 more functions like checkall which will individualy select chkselectmodelpics[],chkselectmodelmsg[],chkselectmodelng[]

 

 

 

 

I hope u got my prb...any help is appreciable...thanks

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...