Показать сообщение отдельно
  #8 (permalink)  
Старый 26.04.2014, 00:45
Аватар для Vlasenko Fedor
Профессор
Отправить личное сообщение для Vlasenko Fedor Посмотреть профиль Найти все сообщения от Vlasenko Fedor
 
Регистрация: 13.03.2013
Сообщений: 1,572

<?php 
var_dump($_POST);
?>
<!DOCTYPE HTML>
<html>
  <head></head>
  <body>
	<div id="resultmsg"></div>
    <input type="text" name="price1" value="4">
    <input type="text" name="price2" value="3">
    <input type="text" name="level" value="2">
    <input type="text" name="level2" value="1">
	<input type="button" value="Send" id="send">
	<script type='text/javascript' src='http://code.jquery.com/jquery-1.9.1.js'></script>
    <script>
	$(function(){
	$("#send").on("click", function(){
      var price = $("input[name^=price]").map(function () {
        return $(this).val();
      }).get();
		var level = $("input[name^=level]").map(function () {
			return $(this).val();
		}).get();
      $.post('send.php', {
        price: price,
		level: level
      }, function (data) {
        $("#resultmsg").html(data);
      });
	});
	});
    </script>
  </body>
</html>
Ответить с цитированием