Skip to content

Instantly share code, notes, and snippets.

@sorie
Last active August 29, 2015 14:24
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 sorie/5acefd6f34067936c416 to your computer and use it in GitHub Desktop.
Save sorie/5acefd6f34067936c416 to your computer and use it in GitHub Desktop.
<!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