发生 onChange 事件时,我正在尝试重新加载 iframe
这是我在标题中的 javascript 标签中得到的内容
`
function getSchedule(oEvent)
{
var n = document.getElementById("wantedTherapist");
var newn = n.options[n.selectedIndex].value;
window.frames['schedule'].src = "schedule.php?therapist="+newn;
}
`
然后是我的 iframe 标签
iframe id="schedule" name="schedule" src="schedule.php"></iframe>
最后是我的选择框
<select id="wantedTherapist" name="wantedTherapist" onchange="getSchedule(Event)">
?php
$query = "SELECT
therapistTable.*
FROM
therapistTable
WHERE
therapistTable.activated = 'true'
";
$result = mysql_query($query) or die (mysql_error());
while($array = mysql_fetch_assoc($result))
{
extract($array);
echo "<option value=\"$username\">$username - $city</option>";
}
?
</select>
我把箭头从 php 标签和第一个箭头从 iframe 上取下来,这样它就会有问题地显示出来。它在 iframe 中加载 schedule.php 但不发送变量,我做错了什么?感谢您提前提供任何建议