Validating Forms

Question: Please tell me how can I validate using a separate Javascript file in my HTML page?

Answer: There are lots of pages on this site that can help you with this. The first thing you will need to do is call a javascript validation function when the submit button on your form is pressed.

You will then need to add validation for radio buttons and text fields.

You may also wish to add validations for credit card numbers, date selection, limit textarea text length, and even restrict what can be entered in fields.

You can place all of this into an external javascript that is linked to from your page.


This article written by Stephen Chapman, Felgall Pty Ltd.

go to top

FaceBook Follow
Twitter Follow