4
1
Fork 0

Jquarry und login

This commit is contained in:
Alpha 2018-02-20 02:25:27 +01:00
parent 34f9431345
commit be4ba34a2d

View file

@ -1,23 +1,29 @@
<form action="action_page.php">
<div class="imgcontainer">
<img src="img_avatar2.png" alt="Avatar" class="avatar">
</div>
<div class="container">
<label for="uname"><b>Nutzername</b></label>
<input type="text" placeholder="Enter Username" name="uname" required>
<label for="psw"><b>Passwort</b></label>
<input type="password" placeholder="Enter Password" name="psw" required>
<button type="submit">Login</button>
<label>
<input type="checkbox" checked="checked" name="remember"> Remember me
</label>
</div>
<div class="container" style="background-color:#f1f1f1">
<button type="button" class="cancelbtn">Cancel</button>
<span class="psw">Forgot <a href="#">Passwort??</a></span>
</div>
</form>
<html>
<head>
<title>Session Management in NodeJS using Express4.2</title>
<script src="../jquery-3.3.1.min.js"></script>
<script>
$(document).ready(function(){
var email,pass;
$("#submit").click(function(){
email=$("#email").val();
pass=$("#password").val();
/*
* Perform some validation here.
*/
$.post(window.location.href,{email:email,pass:pass},function(data){
if(data==='done')
{
window.location.href="/admin";
}
});
});
});
</script>
</head>
<body>
<input type="text" size="40" placeholder="Type your email" id="email"><br />
<input type="password" size="40" placeholder="Type your password" id="password"><br />
<input type="button" value="Submit" id="submit">
</body>
</html>