06.05
Input validation with javascript is an essential part of any large day to day website. Its major advantage is that it can be processed client side thus avoiding avoidable load on the server.
If your running a PHP based website which is struggling to cope with load and your using basic php form validation. You could switch your form validation to Javascript.
You should treat your javascript validation as your first line of defence, as javascript source can be read by a user its easy enough to work around it if you know what your doing. So you will still need to keep your second line of defence ie your PHP code to do the second lot of checking.
However the javascript will help to limit load for people who genuinely make honest mistakes.
Heres a example of form validation.
Firstly lets make our Form
[sourcecode='html']
No Comment.
Add Your Comment