hi
this is the dynamic forms
----------------------------------------------------------------------------------------------------------------------------------------------------------------
for($s=0;$s<$num;$s++)
{
$result = mssql_fetch_array($query);
$result[2] = number_format($result[2], 2);
echo "<tr border=1>";
echo "<td><input type=\"text\" name=\"item\" size=40 value=$result[0]
disabled> </td>";
echo "<td><input type=\"text\" name=\"amount\" size=7 value=$result[2]
disabled></td>";
echo "<td><input type=\"text\" name=\"quantity[]\" size=7></td>";
echo "<td><input type=\"text\" name=\"discount[]\" size=7 value=\"0\"></td>";
echo "<input type=\"hidden\" name=\"part_no[]\" value=\"$result[0]\">";
echo "<input type=\"hidden\" name=\"price[]\" value=\"$result[2]\">";
echo "<input type=\"hidden\" name=\"salesperson_code[]\"
value=$salesperson_code>";
echo "<input type=\"hidden\" name=\"customer_code[]\" value=$customer_code>";
echo "<input type=\"hidden\" name=\"ship_to_code[]\" value=$ship_to_code>";
echo "<input type=\"hidden\" name=\"date[]\" value=\"$date\">";
echo "<input type=\"hidden\" name=\"status[]\" value=\"0\">";
echo "<td><input type=\"checkbox\" name=\"check[]\" value=\"$s\"></td>";
echo "</tr>";
}
----------------------------------------------------------------------------------------------------------------------------------------------------------------
this the code that will get items that are checked
foreach($check as $checkitem)
{
echo $quantity[$checkitem] . " " . $discount[$checkitem] . " " . $part_no[$checkitem]
. " " . $price[$checkitem] . " " . $salesperson_code[$checkitem] . " " .
$customer_code[$checkitem] . " " . $ship_to_code[$checkitem] . " " . " " .
$status[$checkitem] . " " . $date[$checkitem] . "<br>";
}
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
the problems / situation
how can i check or validate
it should be. if someone filled up the $quantity[] field, she / he must check the
$check[] field or if a use check the $check[] field
he must put something on the $quantity[] field. and
otherwise empty $quantity[] field and empty $check[] field is allowed,
thanks in advance