parent.window problem with select list


J

John Peach

From an intranet sit i am running a function from a onchange event:

<script language='javascript'>
function update(a)
{
var url="dropdownupdate.asp";
url=url + "?id=" + a.name;
url=url + "&val=" + a.value

window.open(url)
}
<script>

that opens this asp page. the page will not update the parent though, any
ideas why ? The parent field 'product is cleared of it's default vallue but
it is not replaced with the new value

<%
Dim cn
Dim sql
Dim rs
Dim id
Dim vl

set cn=Server.CreateObject("ADODB.Connection")
cn.Open "Provider=SQLOLEDB.1;Password=glencoe;Persist Security
Info=True;User ID=qadmin;Initial Catalog=UserInfo;Data Source=TLGUKSP17"
set RS =Server.CreateObject("ADODB.Recordset")

id =request.querystring ("id")
vl = request.querystring("val")

if id="Range" then
sql ="SELECT Product FROM Menlosoft WHERE (Range = N'" & vl & "') GROUP BY
Product"
rs.open sql,cn
end if

counter=0

response.write "<script language='javascript'>"
response.write " var selectbox=window.opener.document.form2.Product;"

do while not rs.eof

response.write "selectbox.options[" & counter & "]=new Option('" &
rs.fields(0) & "','" & rs.fields(0) & "');"
response.write "selectbox.options[1]=new Option('help','help');"
counter=counter+1
rs.movenext
loop

response.write "</script>"
rs.close
set rs=nothing

window.close()
%>

thanks in anticipation of assistance

John
 
Ad

Advertisements


Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top