Article
JavaScript 101 - Part 3
Summary and Further Reading
In this article I have described the basic techniques for client-side validation of form submissions with JavaScript. I showed how to enforce required fields, checkboxes, and radio buttons. I also discussed how to ensure that a valid item is selected from an HTML selection list, and how to enforce a limit on the maximum number of characters in a text area.
More complex forms of validation (e.g. checking that a valid email address or phone number were entered into a text field) are also possible using an advanced feature of JavaScript called regular expressions. If you’re interested in learning about regular expressions in JavaScript, I would suggest reading my article by the same name.
This article also concludes the JavaScript 101 series, which means that you are now equipped with an understanding of the basics of JavaScript and how it can be used on the Web. There’s still plenty to learn, however, and one of the best ways to take the next step is to have a look at the JavaScript code used on other sites to achieve the effects you’re interested in. And of course, I invite you to continue learning with us by checking out some of the other JavaScript articles on this site.