Use javascript on register1 rather than actually submitting the form to the server. It's the best way to do this, plus it's a bit quicker. If you have javascript questions, those are for another forum.
-Brent ----- Original Message ----- From: "Francis Chang" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, September 02, 2004 3:37 AM Subject: [PHP] Newbie: Validate Required Form Fields > Hello All, > > I have a newbie question related to validating required Form fields. > > Suppose we have a two-step user registration process with scripts > register1.php and register2.php, each page containing a set of required and > non-required fields. In register1.php, when user submits the form, it calls > register2.php as the action. In register2.php, I want to validate the Form > values submitted by the user in register1.php and if any of the required > fields is missing a value, I want to re-dispaly the register1.php page with > the appropriate error message. > > What is the most appropriate way to handle this? Once the validation fails > in register2.php, can I call register1.php with parameters? If so, how? Or > do I use session variables to capture the error information? How do I > redirect to register1.php from within the code execution of register2.php? > > Thanks in advance for your help. > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php