Validating forms in coldfusion method of radioactive dating

Our example script works by validating all the form fields at once.This can be a bit confusing for the user, especially if they've missed out more than one field, as they will get lots of alert boxes appearing and they might forget which fields they need to fill in!I have a registraion form setup with javascript validation in place, but there is one place I'm having trouble.I have a dropdown selection list, and based on the selection, there are text fields that are hidden or displayed for more info.As an exercise, try modifying the script to only prompt the user one field at a time.

Let's expand this example with a more complex function that checks lots of form fields.You might like to open the source code for this form in a separate window, so that you can refer to it throughout the tutorial.You can see that the page consists of a Java Script function called That's all there is to simple Java Script form validation!There are two main methods for validating forms: (usually done using Java Script).Server-side validation is more secure but often more tricky to code, whereas client-side (Java Script) validation is easier to do and quicker too (the browser doesn't have to connect to the server to validate the form, so the user finds out instantly if they've missed out that required field! In this tutorial we'll build a simple form with client-side Java Script validation.

Leave a Reply