Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $('#patientForm').submit(function(e) {
- var ref = $(this).find("[required]");
- $(ref).forEach(function() {
- console.log(ref.length);
- if ($(this).val() === '') {
- alert("Required field should not be blank.");
- $(this).focus();
- e.preventDefault();
- // return false;
- } else {
- console.log("else statement is running");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement