I have the following form:
If you are a beginner of javascript, a better option would be
Add HTML as follows
Now add validateForm()
as
function validateForm() {
// Validate all fields in the form
return true; // if all form entries are valid. else return false
}
Note: This will not grey-out the submit button. But in this case submit will work only if all the entries are valid.