ASP with Javascript

Discussion in 'ASP General' started by kelvin, Apr 28, 2004.

  1. kelvin

    kelvin Guest

    Hi how do I solve this problem.

    This code resides in a popup window and when the user click on the
    links,
    it's suppose to return the value to the main window.

    However the code below doesn't work because the <a href> link does not
    work at all.

    Can someone help? Your help is much appreciated!


    <% WHILE NOT recordset_uldType.eof %>
    <tr bordercolor="#FFFFFF">
    <td width="8%">
    <% loc = "javascript:eek:pener.document.forms[1].elements[11].value=" &
    recordset_uldType("code") & ";self.close()" %>
    <a href="<%=loc%>"> <%=recordset_uldType("code")%></a></td>
    <td width="92%<%=recordset_uldType("description")%></td>
    </tr>
    <% recordset_uldType.movenext
    Wend
    %>
     
    kelvin, Apr 28, 2004
    #1
    1. Advertising

  2. kelvin

    Evertjan. Guest

    kelvin wrote on 28 apr 2004 in microsoft.public.inetserver.asp.general:

    > Hi how do I solve this problem.
    >
    > This code resides in a popup window and when the user click on the
    > links,
    > it's suppose to return the value to the main window.
    >
    > However the code below doesn't work because the <a href> link does not
    > work at all.
    >
    > Can someone help? Your help is much appreciated!
    >
    >
    > <% WHILE NOT recordset_uldType.eof %>
    > <tr bordercolor="#FFFFFF">
    > <td width="8%">
    > <% loc =
    > "javascript:eek:pener.document.forms[1].elements[11].value=" &
    > recordset_uldType("code") & ";self.close()" %>
    > <a href="<%=loc%>"> <%=recordset_uldType("code")%></a></td>
    > <td width="92%<%=recordset_uldType("description")%></td>
    > </tr>
    > <% recordset_uldType.movenext
    > Wend
    > %>
    >


    Translate this first to readable ASP:


    <%
    WHILE NOT recordset_uldType.eof
    %>

    <tr bordercolor="#FFFFFF"><td width="8%">

    <%
    loc ="javascript:eek:pener.document.forms[1].elements[11].value='"
    loc = loc & recordset_uldType("code") & "';self.close()"
    %>

    <a href="<% = loc%>">
    <% = recordset_uldType("code")%>
    </a>

    </td><td width="92%">
    <% = recordset_uldType("description")%>
    </td></tr>

    <%
    recordset_uldType.movenext
    Wend
    %>

    ================

    1 You missed 2 chars afer the 92%

    2 You should have single quotes in the opener...='...'
    [caring for spaces inside]

    3 it all depends on the contents of your database items.

    4 now temporarily change the <a..></a> part to:

    <a
    href="javascript:eek:pener.document.forms[1].elements[11].value=
    'XX';self.close()">
    insert XX in the form element
    </a>

    If this does not work, you have a clientside javascript problem, not an
    serverside ASP one or a database one.


    --
    Evertjan.
    The Netherlands.
    (Please change the x'es to dots in my emailaddress)
     
    Evertjan., Apr 28, 2004
    #2
    1. Advertising

  3. kelvin

    Larry Bud Guest

    (kelvin) wrote in message news:<>...
    > Hi how do I solve this problem.
    >
    > This code resides in a popup window and when the user click on the
    > links,
    > it's suppose to return the value to the main window.
    >
    > However the code below doesn't work because the <a href> link does not
    > work at all.
    >
    > Can someone help? Your help is much appreciated!
    >
    >
    > <% WHILE NOT recordset_uldType.eof %>
    > <tr bordercolor="#FFFFFF">
    > <td width="8%">
    > <% loc = "javascript:eek:pener.document.forms[1].elements[11].value=" &
    > recordset_uldType("code") & ";self.close()" %>
    > <a href="<%=loc%>"> <%=recordset_uldType("code")%></a></td>
    > <td width="92%<%=recordset_uldType("description")%></td>
    > </tr>
    > <% recordset_uldType.movenext
    > Wend
    > %>


    This should be in a javascript newsgroup. ASP has nothing to do with
    your error.

    Your javascript code returns the value to the 11th element in the form
    of the page which opens this popup. Have you changed the original
    form? Perhaps there is no 11th element, or it's not a text box.
     
    Larry Bud, Apr 28, 2004
    #3
  4. kelvin

    Kelvin Teh Guest

    Thanks Evertjan! It works now.

    Really thank you very much!



    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
     
    Kelvin Teh, Apr 30, 2004
    #4
    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. David Virgil Hobbs
    Replies:
    0
    Views:
    537
    David Virgil Hobbs
    Jan 6, 2004
  2. mcdeveloper
    Replies:
    1
    Views:
    4,250
    mcdeveloper
    Jun 13, 2006
  3. CRON
    Replies:
    24
    Views:
    202,928
    Adrienne Boswell
    Jun 20, 2006
  4. Mark Rae

    JavaScript or not JavaScript

    Mark Rae, Sep 5, 2006, in forum: ASP .Net
    Replies:
    36
    Views:
    1,120
    Paul Sture
    Sep 9, 2006
  5. John Davis

    ASP JavaScript versus ASP VBScript

    John Davis, Sep 6, 2003, in forum: ASP General
    Replies:
    5
    Views:
    147
    Curt_C [MVP]
    Sep 7, 2003
Loading...

Share This Page