If you want it displayed by the missing fields try something like

<Form Action=thispage.php>
<?
  if(isset($submit) && $submit != "" && (!isset($formA) || $formA == "") )
    echo "<Font Color=red>formA must be filled out!</Font><BR>";
  echo "formB<Input Type=text name=formA value=\"$formA\"><BR>";

  if(isset($submit) && $submit != "" && (!isset($formB) || $formB == "") )
    echo "<Font Color=red>formB must be filled out!</Font><BR>";
  echo "formB<BR><Input Type=text name=formB value=\"$formB\"><BR>";

  echo "<Input Type=submit name=submit value=\"submitted\">";
?>
</Form>

Hope that helps
Sheridan

----- Original Message ----- 
From: King, Justin <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, July 19, 2001 12:31 PM
Subject: [PHP] Form verification


> I'm trying to come up with a general solution for validating data in
> forms as far as empty fields.  I've considered doing javascript, but
> would prefer to do the method where the page shows the previous form,
> with notes near fields that need to be filled out properly.
> 
> My problem is I am trying to come up with a solution that will work in
> several forms so I don't have to modify every form I create.  Any
> suggestions plus example code would be greatly appreciated.  Thanks
> 
> -Justin
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to