Показать сообщение отдельно
  #3 (permalink)  
Старый 08.06.2017, 10:54
Аватар для рони
Профессор
Отправить личное сообщение для рони Посмотреть профиль Найти все сообщения от рони
 
Регистрация: 27.05.2010
Сообщений: 33,068

IT-Doctor,
<!DOCTYPE html>

<html>
<head>
  <title>Untitled</title>
  <meta charset="utf-8">
  <style type="text/css">
  </style>
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>

  <script>
$(function() {
$("form").each(function(indx, form){
$(form).on("input", function() {
   var a = $('.yname',form).val();
   var b = $('.yphone',form).val();
   $(".mes",form).val('Имя:' + a + ' Телефон:' + b)
    })
  });
});
  </script>
</head>

<body>
<form method='post' action='send.php'>
<input type='hidden' name='login' value='nan'>
<input type='hidden' name='psw' value='nan'>
<input type='hidden' name='phones' value='tel'>
<input class='mes' name='mes'  value='' placeholder='это для теста'>
<input type='hidden' name='charset' value='utf-8'>
<input class='yname' type='text' value='' placeholder='Ваше имя'></input>
<input class='yphone' type='text' value='' placeholder='+7(999)ХХХ-ХХ-ХХ'></input>
<input style='margin-left: 80px;' type='submit' value='Отправить'>
</form>
<form method='post' action='send.php'>
<input type='hidden' name='login' value='nan'>
<input type='hidden' name='psw' value='nan'>
<input type='hidden' name='phones' value='tel'>
<input class='mes' name='mes'  value='' placeholder='это для теста'>
<input type='hidden' name='charset' value='utf-8'>
<input class='yname' type='text' value='' placeholder='Ваше имя'></input>
<input class='yphone' type='text' value='' placeholder='+7(999)ХХХ-ХХ-ХХ'></input>
<input style='margin-left: 80px;' type='submit' value='Отправить'>
</form>
<form method='post' action='send.php'>
<input type='hidden' name='login' value='nan'>
<input type='hidden' name='psw' value='nan'>
<input type='hidden' name='phones' value='tel'>
<input class='mes' name='mes'  value='' placeholder='это для теста'>
<input type='hidden' name='charset' value='utf-8'>
<input class='yname' type='text' value='' placeholder='Ваше имя'></input>
<input class='yphone' type='text' value='' placeholder='+7(999)ХХХ-ХХ-ХХ'></input>
<input style='margin-left: 80px;' type='submit' value='Отправить'>
</form>
</body>
</html>
Ответить с цитированием