jQuery(function($){
$(document).mouseup(function (e){
var div = $("#popup2");
if (div.is(e.target)
&& div.has(e.target).length === 0) {
div.hide();
$(".b-popup").hide();
}
});
});
$('.header-auth__signup').click(function(){
$("#popup2").show();
});
<?php require "db.php"?>
<?php
$data = $_POST;
if ( isset($data['do_signup'])){
$errors = array();
if ( trim($data['login']) == '')
{
$errors[] = 'Введите логин!';
}
if ( trim($data['email']) == '')
{
$errors[] = 'Введите email!';
}
if ( ($data['password']) == '')
{
$errors[] = 'Введите пароль!';
}
if ( ($data['password']) != ($data['password2']))
{
$errors[] = 'Вы неправильно ввели повторный пароль!';
}
if (empty($errors)){
// Регаем
}
else
{
echo 'false';
}
}
?>
<form action="" method="POST">
<div class="b-popup__name">
<span>Имя</span>
<input type="text" name="login" required>
</div>
<div class="b-popup__email">
<span>Email</span>
<input type="email" name="email" required>
</div>
<div class="b-popup__pass">
<span>Пароль</span>
<input type="password" name="password" required>
</div>
<div class="b-popup__pass">
<span>Подтвердите пароль</span>
<input type="password" name="password2" required>
</div>
<button type="submit" name="do_signup" class="b-popup__btn">Зарегистрироваться</button>
</form>
{% if galery is not empty %}
<p>Idea</p>
{{ wp.do_shortcode('[post_gallery]') }}
{% endif %}