web form - don't send if line isn't filled out

A

Anonymous

Guest
You can probably add an if statement around each block:

Code:
if isset($line1qty)
{
    // Line 1 Email Information
   $email_message .= "Line 1\n";
    $email_message .= "Quantity: ".$line1qty."\n";
   $email_message .= "Part Number: ".$line1pn."\n";
   $email_message .= "Manufacturer: ".$line1mfg."\n";
   $email_message .= "Description: ".$line1descr."\n\n";
   }
 
You would have to do the same for line 2...

Code:
if (isset($line2qty))
{
    // Line 2 Email Information.......
   }
 
I can't see the html of your form, but instead of isset you could try

Code:
if (strlen($line2qty) > 0)
{....
}
 
Back
Top