Skip to content

Instantly share code, notes, and snippets.

@powerbot15
Last active March 16, 2016 12:14
Show Gist options
  • Save powerbot15/30674db630c552b4955f to your computer and use it in GitHub Desktop.
Save powerbot15/30674db630c552b4955f to your computer and use it in GitHub Desktop.
$('document').on('submit', 'form', submitMany);
function submitMany(){
var form = $(this);
if(validateAction(form.prop('action'))){
alert('!!!');
}
}
function validateAction(action){
var valid = {
'confirm-availability' : true,
'request-more-info' : true,
'test-drive-this-car' : true
};
return valid[action];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment