Created
January 21, 2011 20:02
-
-
Save nicinabox/790299 to your computer and use it in GitHub Desktop.
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
$('form').submit(function() { | |
// get all the inputs into an array. | |
var $inputs = $('#form :input'); | |
// get an associative array of just the values. | |
var values = {}; | |
$inputs.each(function() { | |
values[this.name] = $(this).val(); | |
if ($(this).val() == "") { | |
alert("You haven't filled out all the fields"); | |
return false; | |
} | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment