I'm trying to validate a form using PHP, so that if a user enters a empty value in any of the fields (I have text boxes, drop-down options and radio buttons), data will not be submitted and a red error text will appear above the field.
I tried creating a function that will check if each of the required fields are entered. If they are, data will be saved; if not the form will be printed again with the error. But the problem here is that all the input that the user entered disappears and all the options are unselected.
Is there anyway else to do this?
Please see the FAQ entry http://www.htmlhelp.com/faq/html/forms.html#required-fields
Wow, it's been a while since I've been here - new forums are looking great!
If you want the front end control that JS allows, plus the power of your server side scripting, asynchronous scripting (Ajax) is an option. If you're new to this topic, you should be aware of the host of accessibility problems posed by using Ajax, though.
Powered by Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)