Answer the question
In order to leave comments, you need to log in
Will data be sent?
There is a contact form in a modal window. Two buttons: submit and cancel.
On cancel , form clearing is screwed:
function myFunction() {
document.getElementById("feedback").reset();
}
<div id="myModal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h3 id="myModalLabel" class="text-center">Напишите нам!</h3>
</div>
<div class="modal-body clearfix">
<form id="feedback" class="form-horizontal col-sm-12" role="form" action="https://formspree.io/%mail%" method="POST">
<div class="form-group">
<label>Имя</label>
<input name="name" class="form-control required" placeholder="Ваше имя" data-placement="top" data-trigger="manual" data-content="" type="text" required>
</div>
<div class="form-group">
<label>Сообщение</label>
<textarea name="message" class="form-control" placeholder="Ваше сообщение..." data-placement="top" data-trigger="manual" required></textarea>
</div>
<div class="form-group">
<label>E-Mail</label>
<input name="_replyto" class="form-control email" placeholder="Ваш e-mail, чтобы мы могли связаться с вами" data-placement="top" data-trigger="manual" data-content="" type="email" required>
<input type="text" name="_gotcha" style="display:none" />
<input type="text" name="_format" value="plain" style="display:none" />
<input type="hidden" name="_subject" value="Новое сообщение!" />
<input type="hidden" name="_next" value="none" />
</div>
<div class="form-group">
<label>Телефон</label>
<input name="phone" class="form-control" placeholder="Ваш телефон" data-placement="top" data-trigger="manual" data-content="" type="tel">
</div>
<div class="form-group">
<button type="submit" class="btn btn-success pull-left">Отправить</button>
<button class="btn btn-default mCancel pull-right" data-dismiss="modal" aria-hidden="true" onclick="myFunction()">Отмена</button>
</div>
</form>
</div>
</div>
</div>
</div>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question