Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width">
  <title>JS Bin</title>
</head>
<body>
<script src="https://code.jquery.com/jquery-2.2.4.js"></script>
<form id="services_form_send" action="javascript:void(null);" onsubmit="send_message()">
<h2>Оставьте заявку</h2>
<p>и получите консультацию специалиста <br /> и&nbsp;расчет стоймости услуг</p>
<input type="text" placeholder="Имя" name="client_name" required="" id="client_name" /> 
<input type="text" placeholder="Телефон" name="client_phone" id="client_tel" required="" /> 
<input type="submit" value="Получить консультацию" name="sendform_submit" id="sendform_submit" />
</form>
</body>
</html>
 
function send_message() {
          var msg = $('#services_form_send').serialize();
          $.ajax({
            type: 'POST',
            url: '/send_php/send_msg.php',
            data: msg,
            success: function(data) {
              alert('send good!');
              $('#services_form_send')[0].reset();
            },
            error: function(xhr, str){
              alert('Error: ' + xhr.responseCode + ' Please, try again later.');
            }
          });
        }
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
anonymouspro
0viewers