$('#submit').click(function()
{
var data = JSON.stringify($("#players_form").serializeArray());
alert(data);
$.ajax({ // Send the credential values to another checker.php using Ajax in POST menthod
type : 'POST',
data : data,
url : 'process.php',
success: function(responseText)
{
if(responseText == 1)
{
alert("Sucess");
}
}
在這段代碼中我已經通過了形式值process.php但我不能夠在process.php接收貼出值,可以在任何一個建議我在process.php中獲得數組值的值從AJAX的serializeArray數據接收到處理PHP頁面
<form id="players_form" >
<input type=" text" name="main_name[]" value="">
<input type=" text" name="main_name[]" value="">
<input type=" text" name="main_name[]" value="">
<input type=" text" name="main_name[]" value="">
<input type=" text" name="main_name[]" value="">
<input type=" text" name="sub_name[]" value="">
<input type=" text" name="sub_name[]" value="">
<input type=" text" name="sub_name[]" value="">
<input type=" text" name="sub_name[]" value="">
<input type=" text" name="sub_name[]" value="">
<input type="button" value="Submit" id="submit">
</form>
我想收到 – user1894647
PHP頁面我理解你的problem.you發送錯誤的數據。顯然,Object在jQuery中轉換爲JSON函數,所以要麼使用http://api.jquery.com/serialize/。 –