What you will learn
- Checking for non-empty
- Checking for all letters
- Checking for all numbers
- Checking for floating numbers
- Checking for letters and numbers
- Checking string length
- Email Validation
- Date Validation
- A sample Registration Form
- Phone No. Validation
- Credit Card No. Validation
- Password Validation
- IP address Validation
What is form validation?
Accessing form data
If an HTML document contains more than one forms, they can be accessed as either by document.form_name where form_name is the value of the name attribute of the form element or by document.forms[i] where i is 0, 1,2,3.... and document.forms refers to the first form of the document, document.forms refers to the second form of the document and so on.
Elements of a form can be accessed by document.form_name.form_element where form_name is the value of the name attribute of the form element, form_element is the value of the name attribute of the form's element.
There are other ways of accessing the forms as well as form's elements also using DOM API. But that is beyond the scope of this tutorial.
Test your Programming skills with w3resource's quiz.
- Weekly Trends
- Python Interview Questions and Answers: Comprehensive Guide
- Scala Exercises, Practice, Solution
- Kotlin Exercises practice with solution
- MongoDB Exercises, Practice, Solution
- SQL Exercises, Practice, Solution - JOINS
- Java Basic Programming Exercises
- SQL Subqueries
- Adventureworks Database Exercises
- C# Sharp Basic Exercises
- SQL COUNT() with distinct
- Java Collection Exercises
- SQL COUNT() function
- SQL Inner Join