parent.window problem with select list

Discussion in 'ASP General' started by John Peach, Jul 5, 2007.

  1. John Peach

    John Peach Guest

    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
     
    John Peach, Jul 5, 2007
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Raj
    Replies:
    3
    Views:
    12,944
    gautamkhosla29
    Jun 11, 2009
  2. KenG

    window.open clears parent window

    KenG, Feb 4, 2004, in forum: ASP .Net
    Replies:
    4
    Views:
    7,261
    Mike Hennessy
    Feb 17, 2004
  3. Earl Teigrob
    Replies:
    4
    Views:
    1,181
    Vidar Petursson
    Jun 5, 2004
  4. palmiere
    Replies:
    1
    Views:
    411
    Erwin Moller
    Feb 9, 2004
  5. PWalker
    Replies:
    1
    Views:
    137
    David Lionetti
    Feb 24, 2005
Loading...

Share This Page