Ex No: 6 | FORM VALIDATION |
---|---|
Aim: | To write a JavaScript code to perfrom Form Validation. |
Algorithm | |
Step1: Create a folder “Ex6” to place the HTML files. | |
Step2: Create HTML file “index.html”. | |
Step3: Use document.getElementById to get value of input elements. | |
Step4: Use addEventListener method to add an event to handle Form Submittion. | |
Step5: Check the input is not empty and has correct values. Else display error message. | |
Source Code | Try It |
index.html
|
|
Result: | Thus JavaScript code is written to perform Form Validation. |