Simple JavaScript Form Check


/ Published in: JavaScript
Save to your folder(s)

This is a simple and effective way yo make sure people are actually filing out a form before submitting it. If you need to verify content it should be done server side (so that if you come across the odd person with javascript turned off it wont break something) but if you want to do a js check then you can easily add the code inside each elements if statement.

Also, if your form is larger than just a few items your probably better off doing it from a more advanced, but much smaller script.

Oh, and with it's current setup your submit button needs the type of button, or it needs to be changed to return a true/false once the checks have been processed.

URL: http://fatfolderdesign.com/152/unimportant/simple-javascript-form-check

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.