ОсновноеRadiotalkПользовательское
MPCHAT - CMS хостинг чатов для профессионалов
83   •   Посмотреть все темы

Форма входа для титулки

 

201
Алексей @mega-tron-2019
Помогите пожалуйста, как подключить форму входа такого плана

<button onclick="document.getElementById('id01').style.display='block'" style="width:auto;">Войти</button>

<div id="id01" class="modal">

<form class="modal-content animate" action="/action_page.php">
<div class="imgcontainer">
<span onclick="document.getElementById('id01').style.display='none'" class="close" title="Close Modal">×</span>
<img src="Аватарка" alt="Avatar" class="avatar">
</div>

<div class="container">
<label for="uname"><b>Username</b></label>
<input type="text" placeholder="Enter Username" name="uname" required>

<label for="psw"><b>Password</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" onclick="document.getElementById('id01').style.display='none'" class="cancelbtn">Cancel</button>
<span class="psw">Forgot <a href="#">password?</a></span>
</div>
</form>
</div>

<script>
// Get the modal
var modal = document.getElementById('id01');

// When the user clicks anywhere outside of the modal, close it
window.onclick = function(event) {
if (event.target == modal) {
modal.style.display = "none";
}
}
</script>

Отредактировано mega-tron-2019 - 06.12.2021
20089
Dimitry @Dimitry
поля должны называться nick и pass
name="nick"
name="pass"

201
Алексей @mega-tron-2019
Меня один фиг выкидывает на ту же главную страничку,после того как жму войти в чат

Отредактировано mega-tron-2019 - 06.12.2021
20089
Dimitry @Dimitry
action="/action_page.php"
тоже верный должен быть, по идее можно указать просто
action=""

201
Алексей @mega-tron-2019
А точно все супер

201
Алексей @mega-tron-2019
<form class="modal-content animate" method="post" name="gochat" action="index.php" id="gochat">

вот так верно же???