Created
June 13, 2017 05:52
-
-
Save d3ep4k/d4cf5ee83b451703bde4f6c0fad6f3ba to your computer and use it in GitHub Desktop.
jquery form processing-metamug html
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8" /> | |
<title>FORM PROCESSING</title> | |
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script> | |
</head> | |
<body style="padding:4em;"> | |
<div class="container"> | |
<div class="col-md-3 col-md-offset-2"> | |
<H3>LOGIN PAGE</H3> | |
<form id="x-login-form" > | |
<div class="form-group"> | |
<label for="xuser">Username</label> | |
<input type="text" name="iuser" class="form-control" /> | |
</div> | |
<div class="form-group"> | |
<label for="xpass">Password</label> | |
<input type="password" name="xpass" class="form-control" /> | |
</div> | |
<input type="submit" class="btn btn-danger" value="Submit" class="form-control" /> | |
</form> | |
</div> | |
</div> | |
<!-- Your script will come here --> | |
<script type="text/javascript"> | |
var fn = function(event){ | |
$.ajax({ | |
type:'POST', | |
url: 'https://api.metamug.com/test55/v1.0/form', | |
data: new FormData(this), | |
contentType: false, | |
processData:false | |
}) | |
return false; | |
} | |
//get the form and submit it with a function | |
$('#x-login-form').submit(fn); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment