Page 1 of 1
Which is the best way to validate forms??
Posted: Sat Apr 14, 2007 9:59 pm
by Saganxis
Hi everybody, I just wanted to know which 'd be the best way to validate forms.
I want to want to write some scripts to validate forms, but i want to know the differences between javascript and ajax.
For instance,
http://www.formassembly.com/wForms/v2.0 ... dation.php is javacript validation and its very nice but not ajax.
Are there many security problems with the javascript validations, why ajax or php???
Posted: Sat Apr 14, 2007 10:23 pm
by Benjamin
Best way to validate a form is on the server side.
Posted: Sun Apr 15, 2007 1:32 am
by matthijs
Validation should always be done on the server side. Always. Then, on top of that, you can add client-side validation with javascript. Or Ajax.
The client side validation is there purely for the users' experience, and has nothing to do with security, because anyone can post anything to your server, completely ignoring your client side javascript validation. You improve the experience because when a user fills in a form he gets a warning for a missing or wrong field immediately instead of posting the form and having to wait for the entire page to reload.
Posted: Sun Apr 15, 2007 4:13 am
by Kieran Huggins
I like using regex validation on the client side, but all form data needs to be validated on the server side anyway... without exception!
Posted: Mon Apr 16, 2007 3:08 pm
by Saganxis
Thanks for the replies... i 'll work on that. First with javascript validation and then with server-side validation.
Posted: Tue Apr 17, 2007 2:55 am
by CoderGoblin
I would always tend to code validation on server, then on the javascript side. If not, don't forget to switch of javascript when testing the server side.