Jump to content

How to check if field is empty before submit


NoPHPPhD

Recommended Posts

I would like to make sure that "Quantity" is > zero when this is submitted.
If it is not, I would like to just redisplay the same form.
What do I have to do? Probably very simple, just not searching for the right term.... :-\

[code]
print("<FORM>\n");
print("<FORM ACTION=\"AddRecord.php\" METHOD=\"GET\">\n");
print("<INPUT TYPE=\"TEXT\" NAME=\"Quantity\">\n");
print("<INPUT TYPE=\"HIDDEN\" NAME=\"NBDno\" VALUE = '$pickedNBDno' >\n");

print("<SELECT NAME=\"Measure\">\n");
while($row = mysql_fetch_object($dbResult))
{
print("<OPTION VALUE=\"{$row->WeightID}\"");
print(">{$row->Description}\n");
}
print("</SELECT>\n");

print("<INPUT TYPE=\"submit\">\n");
print("</FORM>\n");
[/code]

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.