這段代碼在firefox中正在工作。在IE中,警報是空的。IE中元素的空值
<select id="ronny" name="ronny" onchange="AjaxPost();alert(document.getElementById('ronny').value);">
<option id="selected_ronny">All</option>
<?php
foreach($d_ronny as $ronny)
{
if ($ronny == $_POST['ronny_select'])
{
echo "<option selected id='selected_ronny'>$ronny</option>";
}
else
{
echo "<option>$ronny</option>";
}
}
?>
</select>
選項有狐狸例如: All
abc
123
xyz
當我選擇xyz
,警報顯示xyz
。在IE中,警報是空的。
謝謝!
你能張貼AjaxPost代碼( )? – xil3 2010-09-19 09:45:44
該帖子很好。問題在於選擇的價值。 – Ronny 2010-09-19 09:46:59
如果您刪除對'AjaxPost();的調用,您可能會發現它的工作原理,所以我們需要明白爲什麼這會中斷。 – Codesleuth 2010-09-19 09:51:30