Last active
August 29, 2015 14:24
-
-
Save sorie/5acefd6f34067936c416 to your computer and use it in GitHub Desktop.
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title></title> | |
<script type="text/javascript" src="//code.jquery.com/jquery-1.11.0.min.js"></script> | |
<script type="text/javascript" src="js/jquery-form.js"></script> | |
</head> | |
<body> | |
<form> | |
<input type="text" name="text2" /><br/> | |
<textarea rows="10" cols="10" name="test3"></textarea><br/> | |
<input type="file" name="test4" /> | |
<input type="submit" value="Submit" /> | |
</form> | |
<script type="text/javascript"> | |
$(function(){ | |
//transform | |
$('#ajaxform').ajaxForm({ | |
beforeSubmit:function(data,frm,opt) { | |
alert("before submit!"); | |
return true; | |
}, | |
success: function(responseText, statusText){ | |
alert("success!"); | |
}, | |
//ajax error | |
error: function(){ | |
alert("error!"); | |
} | |
}); | |
}); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment