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???
Which is the best way to validate forms??
Moderator: General Moderators
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.
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.
- Kieran Huggins
- DevNet Master
- Posts: 3635
- Joined: Wed Dec 06, 2006 4:14 pm
- Location: Toronto, Canada
- Contact:
- CoderGoblin
- DevNet Resident
- Posts: 1425
- Joined: Tue Mar 16, 2004 10:03 am
- Location: Aachen, Germany