modify html
This commit is contained in:
parent
9e02980415
commit
850d0af0bb
1 changed files with 3 additions and 22 deletions
|
@ -12,7 +12,7 @@
|
|||
<body>
|
||||
<div class="container">
|
||||
<h1>Sign In</h1>
|
||||
<form id="loginForm" action="/login" method="GET">
|
||||
<form action="/login" method="GET">
|
||||
<input type="hidden" name="grant_type" value="client_credentials" />
|
||||
<input type="hidden" name="scope" value="all" />
|
||||
<div class="form-group">
|
||||
|
@ -25,29 +25,10 @@
|
|||
</div>
|
||||
<button type="submit" class="btn btn-success">Sign In</button>
|
||||
</form>
|
||||
<form id="registerForm" action="/register.html" method="GET">
|
||||
<form action="/register.html" method="GET">
|
||||
<button type="submit" class="btn btn-primary">Register</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
function submitFormWithReferer(formId) {
|
||||
var form = document.getElementById(formId);
|
||||
var referrer = document.referrer || "";
|
||||
form.insertAdjacentHTML('beforeend', '<input type="hidden" name="referer" value="' + referrer + '">');
|
||||
form.submit();
|
||||
}
|
||||
|
||||
document.getElementById("loginForm").addEventListener("submit", function (event) {
|
||||
event.preventDefault();
|
||||
submitFormWithReferer("loginForm");
|
||||
});
|
||||
|
||||
document.getElementById("registerForm").addEventListener("submit", function (event) {
|
||||
event.preventDefault();
|
||||
submitFormWithReferer("registerForm");
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
|
Loading…
Reference in a new issue