Re: Form verification

From: Date: Thu, 19 Jul 2001 19:10:13 +0000
Subject: Re: Form verification
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-58771@lists.php.net to get a copy of this message
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 <KingJ@superior.k12.wi.us> To: <php-general@lists.php.net> 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: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.general (#58771) next »