Hi,
I'm creating a PHP application. In this a dynamic table with the fields in the database is generated in a page. I have placed a checkbox in each row of the table to approve/disapprove according to spec. This checkbox is also created dynamically according to the fields in the database. Now I need to place a checkbox/ button (by checking the checkbox all the checkbox in the page has to be checked). I checked online and I was able to find the code only for static checkboxes which does not slove my issue..
I here by attach sample of my code..
$result= mysql_query("select * from info where status != 'processed' ;");
// I need to click on this checkbox placed atlast to check all the checkboxes
if($result) echo "<td>Bid</td><td>Item</td><td>Vendor#</td><td>Vendor Name</td><td>G/L Acct</td><td>Invoice</td><td>Invoice Data</td><td>Date Enter</td><td>Remarks</td><td>To Approve all, Click here<input type=\"checkbox\" name=\"master\"></td>";
while($line = mysql_fetch_array($result, MYSQL_ASSOC)) {
echo "<tr>";
// This is the dynamically generated Table with checkbox at last
echo "<td width='10%'><form name=\"formvalid\" action =\"PHP_SELF" method =\"post\" enctype=\"application/x-www-form-urlencoded\" ><input type=\"hidden\" name = \"bld\" value= \"".$line['bld']."\"><input type=\"hidden\" name = \"item\" value= \"".$line['item']."\"><input type=\"hidden\" name = \"vendorno\" value= \"".$line['vendor_no']."\"><input type=\"hidden\" name = \"vendorname\" value= \"".$line['vendor_name']."\"><input type=\"hidden\" name = \"glacct\" value= \"".$line['gl_acct']."\"><input type=\"hidden\" name = \"invoiceno\" value= \"".$line['invoice_no']."\" ><input type=\"hidden\" name = \"invoicedate\" value= \"".$line['invoice_date']."\"><input type=\"hidden\" name = \"remarks\" value= \"".$line['remarks']."\" ><input type=\"checkbox\" name=\"elements\"></input></form></td>";
}
I hope now you would have got a clear picture of whats happening..
Can you pls. help me on this please...
Thanks,
Srikanth