How to do form validation in javascript

The validation part of javascript is very easy This below code block is doing validation if(name == “”) {printError(“nameError”, “Please enter your name”);} else {var regex = /^[a-zA-Z\s]+$/; if(regex.test(name) === false) {printError(“nameError”, “Please enter a valid name”);} else {printError(“nameError”, “”);nameError = false;}} If you run this code in your broswer         Candidate … Continue reading How to do form validation in javascript