我有一段時間試圖找出這一個。也許有人可以幫助我,或者指引我走向正確的方向。
我有一個jQuery UI對話框,當用戶點擊圖像時彈出。該對話框顯示一個包含2個下拉窗口的表單。 「部門」和「組」。分組下拉菜單被禁用,直到在「分部」下拉菜單中選擇某個分組爲止。
當用戶選擇一個部門時,我做了一個POST到php的功能,然後啓用並填充組下拉菜單。夠簡單了...
<select name="dept" id="dept_select" onchange="getDeptGroups(this.value);">
// Some data here
</select>
JS功能:
function getDeptGroups(dept)
{
// This alert works and displays department name.
//alert(dept);
$.post("/am/ldap/getDepartmentGroups.php", {
department: dept },
function(data){
alert(data);
});
}
終於在PHP頁面我只是做
<? print_r($_POST); ?>
,並與空數組結束。
Array
(
)
這發生在兩,Chrome和Firefox,不過,螢火清楚地表明提交後的數據:
Screenshot of FireBug showing POST data http://dl.dropbox.com/u/3903355/post.png
我到底錯在這裏做什麼?
它顯示數據正在提交,但它顯示爲響應? – Galen 2010-05-20 15:44:46
如果你'print_r($ _ REQUEST);' – thetaiko 2010-05-20 15:46:34
你看到了什麼?你是否嘗試過從標準表單發佈?即''form action =「/ am/ldap/getDepartmentGroups.php」method =「post」>' – DisgruntledGoat 2010-05-20 15:47:20