Skip to content

Instantly share code, notes, and snippets.

@avifoxi
Created August 14, 2014 20:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save avifoxi/3489f1e95d93fd956d4b to your computer and use it in GitHub Desktop.
Save avifoxi/3489f1e95d93fd956d4b to your computer and use it in GitHub Desktop.
intercepting form submission - then get the data
// shorthand for $(document).ready();
$(function(){
//Your code...
var f = $('form');
$(f).submit( function(event){
event.preventDefault();
var children = event.currentTarget.childNodes;
var shitwecareabout = []
for (var i = 0; i < children.length; i++) {
if (children[i].tagName === 'INPUT'){
shitwecareabout.push(children[i]);
}
}
shitwecareabout[0].value;
})
});
function validEmail() {
}
function validPword() {
}
// if errors print to screen
// else
// submit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment