Advo wrote:
Quote:
Basically, im redesigning a form page on our website.
>
Currently the user submits the form, it does a few javascript checks
and either submits to the "processstuff.php" page, or gives the user a
JS error message.. where they have to go back and fill the details in.
>
Im trying to optimise and make this form/page as best as it can be.
>
Do you think it would be a better idea to continue using JS or use JS
then submit to the php page(where it checks some other
details(postcode validation) and submits, or just solely use php
validation?
The best is always to do both:
1. JS validation will inform the user instantly that something is not OK,
and it will save him a trip to the server and back: better for the user,
less load on the server: a win-win.
2. JS validation can easily be bypassed or JS can be disabled by the user,
so always, always, check again with PHP on the server itself.
Grtz,
--
Rik Wasmus