Ask a Question related to PHP Development, Design and Development.
-
Aris Santillan #1
Dynamic Form checking
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
Aris Santillan Guest
-
CF7 not checking validated form fields
I have a form at www.scootervilleusa.com/Scooters/Pform.cfm?PID=2 There is a email icon above the table, it should open up another window with... -
Help with my form. Checking existence of variables
I have a form which submits to another page. The submission page checks for the existence of some variables. If they don't exist it assigns a... -
Checking a form before its processed?
I have a simple CFFORM that asks a user for a seach string, that then compares that to a Verity collection. What I am wondering if it is possible... -
[PHP] Dynamic Form checking
if $quantity isn't filled you get NULL or FALSE. so you could use: if ($_POST) etc. Try posting less code and more question to the list. ... -
checking form whitespace
I've created a function that checks form fields that only will have letters. This is the script: <script type="text/javascript"...



Reply With Quote

