Results 1 to 2 of 2
Related
-
required fields in a form Forum: HTML Forum
Replies: 17 -
HTML Form with required fields Forum: HTML Forum
Replies: 10 -
Required Form Fields Forum: Javascript Forum
Replies: 1 -
How do I set up required fields in JMail form? Forum: ASP Forum
Replies: 3
-
06-26-2008, 10:28 AM #1
required form fields in php page using redirect.php form
Hi from a new member~
I want to require all form fields in a php membership registration page. I've tried javascripts in the <head></head> and appropriate labels in the <body>, but the redirect.php in the form command overrides them, apparently, because if I type nothing in the form fields but a password (required by the redirect.php), it processes it. I saw somewhere on this site (can't find it now) that suggested using this code:
<?php
if ($form1 && $form2 && $form3) {
echo "Thank you for submitting your form";
} else {
echo "You have not filled out all the required fields. Place hit your back button and fill out all the required fields.";
}
?>
But do I put that in the <head></head> section and what do "form 1" etc. refer to? Elements of the form? Or would it be better to put all the required elements in the redirect.php file? If so, can you give me an example of how to do one (such as firstname)?
One last question, please: If I fail to fill out the password, I get a popup error, but the page I'm left on is blank. I am not taken back to the register.php page. What is causing that?
Thank you SOooo much!
-
06-26-2008, 12:31 PM #2
Re: required form fields in php page using redirect.php form
Sorry to confuse; the page is html, not php. It's the php script in the form that is causing the problem for me:
<FORM METHOD="POST" ACTION="register.php">
That script seems to override my javascript in the <head></head> of my page, and I've tried 2 different jscripts. The php still takes over and moves me on w/o verifying the form fields. Is that clearer?
Cloudjiffy- PaaS for Developers
10-05-2020, 12:30 AM in Web Hosting Forum