сделан кривой преход на страницу после нажатия кнопки
This commit is contained in:
parent
a04a791ff2
commit
d328acfb93
@ -6,18 +6,17 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>{% WRITE pres.phr.decl.page-login %}</title>
|
||||
<link rel="stylesheet" href="/assets/css/login.css">
|
||||
|
||||
<script src="/assets/js/login.js" defer></script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
{% PUT pass-pres-userinfo pres userinfo %}
|
||||
<div class="form-container">
|
||||
<h1 class="hide-cursor no-select">{% WRITE pres.phr.decl.enter %}</h1>
|
||||
<form action="/login" method="post" enctype="application/x-www-form-urlencoded">
|
||||
<label for="nickname">{% WRITE pres.phr.decl.nickname %}</label>
|
||||
<input type="text" name="nickname" id="nickname"><br>
|
||||
<label for="password">{% WRITE pres.phr.decl.password %}</label>
|
||||
<input type="password" name="password" id="password"><br>
|
||||
<input type="password" name="password" id="password"><br>
|
||||
<button type="submit" class="hide-cursor no-select">{% WRITE pres.phr.act.enter %}</button>
|
||||
</form>
|
||||
</div>
|
||||
|
14
assets/js/login.js
Normal file
14
assets/js/login.js
Normal file
@ -0,0 +1,14 @@
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
function handleSubmit(event) {
|
||||
event.preventDefault();
|
||||
|
||||
const nickname = document.getElementById('nickname').value;
|
||||
const password = document.getElementById('password').value;
|
||||
|
||||
window.location.href = '/assets/HypertextPages/list-rooms.nytl.html';
|
||||
|
||||
}
|
||||
|
||||
const form = document.querySelector('form');
|
||||
form.addEventListener('submit', handleSubmit);
|
||||
});
|
Loading…
Reference in New Issue
Block a user