Probably, but this should also work:
Code:
<script type="text/javascript">
function myFunction(el){
var t = el.form.elements['qty[' + el.value + ']'];
t.disabled = !el.checked;
}
</script>
<style type="text/css">
<!--
.style4 {font-size: 36px}
.style5 {font-size: large}
-->
</style>
</head>
<form method="post" action="transaction_process_guest.php" name="myform">
Table Number: <input type="text" name="table_num" size=5><br>
<table border="0" cellspacing="3" cellpadding="3">
<th></th>
<th>Product Name</th>
<th>Product Price</th>
<th>Product Image</th>
<th>Quantity</th>
<?php
include "connection_dbase_settings.php";
$quer = mysql_query("select * from tbl_products order by product_id");
while($row = mysql_fetch_array($quer))
{
$prod_image = $row[image];
echo "<tr><td></td></tr>";
echo "<tr><td><center><input type=\"checkbox\" name=\"order[]\" value=\"$row[product_id]\" onclick=\"myFunction(this);\"></center></td>";
echo "<td><center>$row[product_name]</center></td>";
echo "<td><center>$row[price]</center></td>";
echo "<td><center><img src=\"http://localhost/CashRegisterPugo/$prod_image\" height=\"50\" width=\"60\"></center></td>";
echo "<td><center><input type=\"text\" name=\"qty[".$row['product_id']."]\" size=\"5\" disabled></center></td></tr>";
}
echo "<tr><td><input type=\"Submit\" value=\"SUBMIT\"></td>";
echo "<td><input type=\"reset\" value=\"CLEAR\"></td></tr>";
?>
Be sure to also add the this keyword as shown in this line:
Code:
echo "<tr><td><center><input type=\"checkbox\" name=\"order[]\" value=\"$row[product_id]\" onclick=\"myFunction(this);\"></center></td>";
Bookmarks