Hey guys,
I'm in the last steps of my project, just a small question here. What
I'm doing right now is using an iframe to populate my drop-down
listboxes and have them display dynamic information from the database.
What I'm trying to do is change the selectedIndex from the iFrame.
Here's a quick snippet of code:
<SCRIPT LANGUAGE="JavaScript">
function testFunc() {
var empID =
document.form1.ddlEmployee.options[document.form1.ddlEmployee.selectedIndex].value;
document.frames("iframequery").location.href=
"/queries.cfm?EmployeeID=" + empID;
return false;
}
</SCRIPT>
<SELECT NAME="ddlEmployee" onChange="return testFunc();">
<OPTION VALUE="">Employee</OPTION>
<CFOUTPUT QUERY="qryEmployee">
<OPTION VALUE="#EmployeeID#">#FirstName# #LastName#</OPTION>
</CFOUTPUT>
</SELECT>
Then, in queries.cfm...
<SCRIPT LANGUAGE="JavaScript">
function refreshWindow() {
parent.window.ddlLocation.setSelectedIndex = 2;
}
</SCRIPT>
....
<BODY ONLOAD="refreshWindow();">
Now, when I call refreshWindow(), I'm getting this error:
'parent.window.ddlLocation' is null or not an object
Anyway, if anyone knows how I can get this to work (setting the drop
down list from the iframe), I would really appreciate it.
Thanks!
Josh.