Find jobs - Find jobs - Pinnacle Sports Review - Debt Consolidation - Wordpress Themes

PDA

View Full Version : Trouble with my form validation. Would appreciate your help


pictureboarduk
Feb 18th 2009, 10:48 am
Hi,

I am trying to validate my contactus form using an external JavaScript script, but also wish to use PHP to send the form to my site's email address.

Can these two technologies work together?

I'm a little unsure.

Many thanks!

gnp
Feb 18th 2009, 5:18 pm
Of course you can use both.

Javascript runs on the client (in the browser) and will validate the user input before allowing the submit.

PHP works on the server and will receive the submitted form and use the data to send the email..

However, you should also validate the user input on the PHP code, because someone without javascript enabled will be able to post un-validated data.. (unvalidated from javascript..)

hope this helps