[問題] Ajax Post陣列的問題
今天網頁上有個表單
裡面有個幾個ckeckbox是複選用陣列存起來
<form name="formA" >
<input type="checkbox" name="paytype[]" value="1">
<input type="checkbox" name="paytype[]" value="2">
<input type="button" onclick="show();">
</form>
<script>
function show()
{
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
{
alert ("Browser does not support HTTP Request");
return;
}
var url="type="+document.formA.paytype.value;//這行有問題
alert(url);
xmlHttp.onreadystatechange=stateChanged ;
xmlHttp.open("POST","getContend.php",true);
xmlhttp.setRequestHeader(
'Content-Type',
'application/x-www-form-urlencoded'
);
xmlHttp.send(url);
}
</script>
在想要取得 document.formA.type.value 的時候會錯誤
請問是哪裡有問題呢
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 60.251.55.25
※ 編輯: kencool107 來自: 60.251.55.25 (07/06 10:53)
推
07/06 12:44, , 1F
07/06 12:44, 1F
推
07/06 12:50, , 2F
07/06 12:50, 2F
我改成別的名字還是不行耶
我有alert( document.formA.paytype ) 他說undefined
※ 編輯: kencool107 來自: 60.251.55.25 (07/06 13:47)
→
07/06 14:03, , 3F
07/06 14:03, 3F
→
07/06 14:04, , 4F
07/06 14:04, 4F
Ajax 近期熱門文章
PTT數位生活區 即時熱門文章