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.
Returns the first defined, non-null argument
const tips_coalesce = (...args) => args.find(v => ![undefined, null].includes(v)); console.log(tips_coalesce(null, undefined, '', NaN, 'Waldo'));
- New Content published on w3resource:
- HTML-CSS Practical: Exercises, Practice, Solution
- Java Regular Expression: Exercises, Practice, Solution
- Scala Programming Exercises, Practice, Solution
- Python Itertools exercises
- Python Numpy exercises
- Python GeoPy Package exercises
- Python Pandas exercises
- Python nltk exercises
- Python BeautifulSoup exercises
- Form Template
- Composer - PHP Package Manager
- PHPUnit - PHP Testing
- Laravel - PHP Framework