HTML
2
Вклад в тег
<form method="post" id="myform">
<input type="text" placeholder="Your name" autofocus required pattern="[a-z]{1,15}"/>
<input type="text" placeholder="Phone-number" required pattern="[0-9]{6,15}"/>
<input type="email" placeholder="Email" required/>
<input class="button" type="button" onclick="sendMyForm();" rel="reg_form" value="request call"/>
</form>
<script type="text/javascript" language="javascript">
function sendMyForm() {
var msg = $('#myform').serialize();
$.ajax({
type: 'POST',
url: 'res.php',
data: msg,
success: function(data) {
$('.popup').fadeIn(500);
$("body").append("<div id='overlay'></div>");
$('#overlay').show().css({'filter' : 'alpha(opacity=80)'});
},
error: function(xhr, str){
alert('Возникла ошибка: ' + xhr.responseCode);
}
});
}
</script>