Last active
August 29, 2015 14:05
-
-
Save hansiemithun/b8d7eb1a8576eac32d42 to your computer and use it in GitHub Desktop.
Just Submit form action
This file contains 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
HTML5 Placeholders checking on Submit | |
$('form').submit(function() { | |
var flag = false; | |
$(this).find('[placeholder]').each(function() { | |
var input = $(this); | |
if (input.val() == input.attr('placeholder')) { | |
input.val(''); | |
input.attr('invalid','invalid'); | |
flag = true; | |
} | |
}); | |
if(flag==true){ | |
return false; | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment