missing required fields

NateMail, ProcessForm, JavaScript Form Validator, Form Security, etc.

missing required fields

Postby comoltd » 01/14/2009 @ 10:38

I am using processform.php, when a required fields are left blank I would like the "back to form" error message to jump directly to the top missing required field, and if possible highlight the missing field. Is this possible? Currently the "back to form" goes to the bottom of the page to the submit button. I want the user to know what was left blank right away. THANKS! [-o<
comoltd
 
Posts: 3
Joined: 11/11/2008 @ 12:08

Re: missing required fields

Postby Nate Baldwin » 01/14/2009 @ 14:07

You'd want to use JavaScript to check your required fields before the visitor even leaves the form in the first place. Could also use JavaScript to highlight the field in question, or any other means of alerting the visitor - it's not something that can generally be done with PHP. I usually recommend using JavaScript for field validation, then using the features built into the PHP scripts as back-up for when the visitor happens to have JavaScript disabled (so it isn't as user friendly, but still works).

I don't have any specific recommendations, but might do a general search for JavaScript Form Validation. Might check out Adobe's Spry options for form validation:
HOME: http://labs.adobe.com/technologies/spry/home.html
EXAMPLES: http://labs.adobe.com/technologies/spry/samples/index.html
Nate Baldwin
Site Admin
 
Posts: 3724
Joined: 04/25/2003 @ 19:05

Re: missing required fields

Postby comoltd » 01/14/2009 @ 14:39

thank you!
comoltd
 
Posts: 3
Joined: 11/11/2008 @ 12:08


Return to Form Processing (NateMail, ProcessForm)



Who is online

Users browsing this forum: Google [Bot] and 0 guests

cron