Jump to content


Photo

createing "select all" checkbox using for loop generated radios


  • Please log in to reply
1 reply to this topic

#1 madolia

madolia
  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 03 August 2006 - 02:16 AM

I have this code which genetares radio buttons using a loop with $i the variable. what i want to do is to create another "select all" button so that when a user clicks, it automatically selects all either approved or reject radio buttons. How to do that?
if(($rowPS["STATUS"] == "") && ($rowLAST["OWNER"] == "-"))
{
echo"
<td align=center><input type=radio name=appr[$i] value='Approved' style=background:#FFFFFF></td>
<td align=center><input type=radio name=appr[$i] value='Rejected' style=background:#FFFFFF></td>";
}
<td colspan=6 align=center>Approve All Request ?  <input type='checkbox' name='a1r1' value='Yes' style=background:#FFFFFF onClick='yesALL()';>Yes</td>


#2 hostfreak

hostfreak
  • Members
  • PipPipPip
  • Advanced Member
  • 581 posts

Posted 03 August 2006 - 05:47 AM

Take a look at this javascript code: http://javascript.in.../check-all.html




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users