Писатель
07 мая 2020 г.
<form novalidate="novalidate" class="LP-form">
<div class="LP-input-block">
<input type="text" class="LP-input" name="email" placeholder="Email" value="">
</div>
<div class="LP-input-block">
<input type="text" class="LP-input" name="name" placeholder="Имя" value="">
</div>
<div class="LP-submit-block">
<button type="submit" class="LP-submit">Подписаться</button>
</div>
</form>
emailfield = LP_tools.element.querySelector('#email-field');
LP_tools.onSubmit = function() {
window.lpLayer = window.lpLayer || {};
window.lpLayer.email = emailfield.value; // Сохраняем значение email во временную переменную
window.LP_show(123456); // Открываем второе окно
}
<div class="LP-input-block">
<input type="text" class="LP-input" name="email" placeholder="Email" value="">
</div>
<input hidden id="email-hidden" type="text" class="LP-input" name="email" placeholder="Email" value="">
<div class="LP-input-block">
<input type="text" class="LP-input" name="name" placeholder="Имя" value="">
</div>
<div class="LP-input-block">
<input type="text" class="LP-input" name="company" placeholder="Компания" value="">
</div>
<div class="LP-input-block">
<input type="text" class="LP-input" name="position" placeholder="Должность" value="">
</div>
А кнопку «Подписаться» переименовываем в «Отправить»:
<div class="LP-submit-block">
<button type="submit" class="LP-submit">Отправить</button>
</div>
<div class="LP-image">
{{image}}
</div>
<div class="LP-content">
{{title}}
{{description}}
<form novalidate="novalidate" class="LP-form">
<input hidden id="email-hidden" type="text" class="LP-input" name="email" placeholder="Email" value="">
<div class="LP-input-block">
<input type="text" class="LP-input" name="commany" placeholder="Компания" value="">
</div>
<div class="LP-input-block">
<input type="text" class="LP-input" name="position" placeholder="Должность" value="">
</div>
<div class="LP-submit-block">
<button type="submit" class="LP-submit">Отправить</button>
</div>
</form>
{{note}}
</div>
<div class="LP-close-x"></div>
123
#email-hidden {
display: none;
}
LP_tools.onShow = function() {
var emailHidden = LP_tools.element.querySelector('#email-hidden');
if (emailHidden && window.lpLayer) {
emailHidden.value = window.lpLayer.email;
}
};