Last active
November 16, 2016 10:11
-
-
Save Archakov06/7f2855f4fc9eecf8727ef94297d48e02 to your computer and use it in GitHub Desktop.
Check all required inputs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// if (!$('#fullname').val()) { | |
// $(this).addClass('error'); | |
// return false; | |
// } | |
// | |
// if (!$('#email').val()) { | |
// $(this).addClass('error'); | |
// return false; | |
// } | |
// | |
// if (!$('#text').val()) { | |
// $(this).addClass('error'); | |
// return false; | |
// } | |
// All required fields | |
var fields = ['fullname','email','text']; | |
for (i in fields) | |
if (!$('#'+fields[i]).val()) { | |
$('#'+fields[i]).addClass('error'); | |
return false; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment