Help with ASP/Java Hyperlink

Discussion in 'ASP General' started by Don Grover, Jan 25, 2005.

  1. Don Grover

    Don Grover Guest

    I hope some one can help, I have a html table that is created with asp that
    has a row of repeated buttons down the side.
    these call a page passing a query string with invoice number.

    I need to get a Java Yes/No dialog up and on yes call the hyperling query
    string.
    I can do this with a single hyperlink but not passing on the query string
    and invnumber

    Here is my Response Write link
    <a href='trackselinv.asp?noreorder=" & iInvoiceID & "'><img border='0' width
    ='20' height='20' src='" & sApplicationLoc & "orderinactive.gif' alt='Set
    order # " & iInvoiceID & " To NOT RE-ORDER'></a>

    Here is my Java but I don't know how to pass on noreorder=MyVar to the
    function ?
    I think i need to call the function in link and pass on myVar, any help much
    appreciated.

    <script type="text/javascript">
    <!--
    function clearcart() {
    var answer = confirm("Are you sure you want to Cancel Reordering?")
    if (answer){
    alert("Cart Cleared!")
    window.location = "'trackselinv.asp?noreorder=MyVar";
    }
    else{
    }
    }
    //-->
    </script>

    Regards
    Don Grover
     
    Don Grover, Jan 25, 2005
    #1
    1. Advertising

  2. Don Grover

    Roland Hall Guest

    "Don Grover" wrote in message news:...
    :I hope some one can help, I have a html table that is created with asp that
    : has a row of repeated buttons down the side.
    : these call a page passing a query string with invoice number.
    :
    : I need to get a Java Yes/No dialog up and on yes call the hyperling query
    : string.

    Java or j(ava)script? J(ava)script is not java. Also, ASP is server-side
    scripting, as I'm sure you are aware and <script> unless runat="server" is
    client-side code. Granted you need to pass a variable from server to client
    side but then it helps to show the server side code.

    : I can do this with a single hyperlink but not passing on the query string
    : and invnumber
    :
    : Here is my Response Write link
    : <a href='trackselinv.asp?noreorder=" & iInvoiceID & "'><img border='0'
    width
    : ='20' height='20' src='" & sApplicationLoc & "orderinactive.gif' alt='Set
    : order # " & iInvoiceID & " To NOT RE-ORDER'></a>
    :
    : Here is my Java but I don't know how to pass on noreorder=MyVar to the
    : function ?

    It would have been nice to see what you have now.

    : I think i need to call the function in link and pass on myVar, any help
    much
    : appreciated.

    in line or in link? Not sure what in link means.

    : <script type="text/javascript">
    : <!--
    : function clearcart() {
    : var answer = confirm("Are you sure you want to Cancel Reordering?")
    : if (answer){
    : alert("Cart Cleared!")
    : window.location = "'trackselinv.asp?noreorder=MyVar";
    : }
    : else{
    : }
    : }
    : //-->
    : </script>

    Here is one problem... where is the other ' (single quote)?
    : window.location = "'trackselinv.asp?noreorder=MyVar";

    Not seeing your ASP script leaves me guessing. Here are two possibilities.

    )1)
    %><!-- shows end of ASP code -->
    <script type="text/javascript">
    function clearcart() {
    var answer = confirm("Are you sure you want to Cancel Reordering?")
    if (answer){
    alert("Cart Cleared!")
    window.location = "trackselinv.asp?noreorder=<% = MyVar %>";
    }
    }
    </script>
    <% ' --- ASP code begins again here ---

    )2)
    <%
    sub prt(str)
    Response.Write str & vbCrLf
    end sub

    prt "<script type=""text/javascript"">" & vbCrLf & _
    "function clearcart() {" & vbCrLf & _
    " var answer = confirm(""Are you sure you want to Cancel Reordering?"")"
    & vbCrLf & _
    " if (answer){" & vbCrLf & _
    " alert(""Cart Cleared!"")" & vbCrLf & _
    " window.location=""trackselinv.asp?noreorder=" & MyVar & "";" & vbCrLf &
    _
    " }" & vbCrLf & _
    "}" & vbCrLf & _
    "</script>"
    %>

    HTH...

    --
    Roland Hall
    /* This information is distributed in the hope that it will be useful, but
    without any warranty; without even the implied warranty of merchantability
    or fitness for a particular purpose. */
    Technet Script Center - http://www.microsoft.com/technet/scriptcenter/
    WSH 5.6 Documentation - http://msdn.microsoft.com/downloads/list/webdev.asp
    MSDN Library - http://msdn.microsoft.com/library/default.asp
     
    Roland Hall, Jan 25, 2005
    #2
    1. Advertising

  3. Don Grover

    Evertjan. Guest

    On 25 jan 2005, you wrote in microsoft.public.inetserver.asp.general:

    > Here is my Response Write link
    > <a href='trackselinv.asp?noreorder=" & iInvoiceID & "'><img border='0'
    > width ='20' height='20' src='" & sApplicationLoc & "orderinactive.gif'
    > alt='Set order # " & iInvoiceID & " To NOT RE-ORDER'></a>
    >
    > Here is my Java but I don't know how to pass on noreorder=MyVar to the
    > function ?
    > I think i need to call the function in link and pass on myVar, any
    > help much appreciated.
    >
    > <script type="text/javascript">
    > <!--
    > function clearcart() {
    > var answer = confirm("Are you sure you want to Cancel Reordering?")
    > if (answer){
    > alert("Cart Cleared!")
    > window.location = "'trackselinv.asp?noreorder=MyVar";
    >}
    > else{
    >}
    >}
    > //-->
    > </script>



    <a href='trackselinv.asp?noreorder=<% =iInvoiceID %>'
    onclick='return clearcart()'>
    <img src='<% =sApplicationLoc %>orderinactive.gif'
    alt='Set order # <% =iInvoiceID %> To NOT RE-ORDER'>
    </a>

    <script type="text/javascript">
    function clearcart() {
    if (confirm("Cancel Reordering?")) {
    alert("Cart Cleared!");
    return true;
    };
    alert("Cart NOT Cleared!");
    return false;
    };
    </script>


    --
    Evertjan.
    The Netherlands.
    (Replace all crosses with dots in my emailaddress)
     
    Evertjan., Jan 25, 2005
    #3
  4. Don Grover

    Don Grover Guest

    Thank's Evertjan
    I did not think of returning true, works like a dream.
    Im tossing up if i should do a Java course or Advanced MSSQL, maybe ill do
    the J first :cool:

    Thanks Don


    "Evertjan." <> wrote in message
    news:Xns95E96A8512550eejj99@194.109.133.29...
    > On 25 jan 2005, you wrote in microsoft.public.inetserver.asp.general:
    >
    >> Here is my Response Write link
    >> <a href='trackselinv.asp?noreorder=" & iInvoiceID & "'><img border='0'
    >> width ='20' height='20' src='" & sApplicationLoc & "orderinactive.gif'
    >> alt='Set order # " & iInvoiceID & " To NOT RE-ORDER'></a>
    >>
    >> Here is my Java but I don't know how to pass on noreorder=MyVar to the
    >> function ?
    >> I think i need to call the function in link and pass on myVar, any
    >> help much appreciated.
    >>
    >> <script type="text/javascript">
    >> <!--
    >> function clearcart() {
    >> var answer = confirm("Are you sure you want to Cancel Reordering?")
    >> if (answer){
    >> alert("Cart Cleared!")
    >> window.location = "'trackselinv.asp?noreorder=MyVar";
    >>}
    >> else{
    >>}
    >>}
    >> //-->
    >> </script>

    >
    >
    > <a href='trackselinv.asp?noreorder=<% =iInvoiceID %>'
    > onclick='return clearcart()'>
    > <img src='<% =sApplicationLoc %>orderinactive.gif'
    > alt='Set order # <% =iInvoiceID %> To NOT RE-ORDER'>
    > </a>
    >
    > <script type="text/javascript">
    > function clearcart() {
    > if (confirm("Cancel Reordering?")) {
    > alert("Cart Cleared!");
    > return true;
    > };
    > alert("Cart NOT Cleared!");
    > return false;
    > };
    > </script>
    >
    >
    > --
    > Evertjan.
    > The Netherlands.
    > (Replace all crosses with dots in my emailaddress)
    >
     
    Don Grover, Jan 25, 2005
    #4
  5. Don Grover

    Evertjan. Guest

    Don Grover wrote on 25 jan 2005 in microsoft.public.inetserver.asp.general:
    > Im tossing up if i should do a Java course


    [please no topposting on usenet]

    Don, Java is quite another language and is NOT a compiler form of
    Javascript.

    > I did not think of returning true, works like a dream.


    I'm glad.

    --
    Evertjan.
    The Netherlands.
    (Replace all crosses with dots in my emailaddress)
     
    Evertjan., Jan 25, 2005
    #5
    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. Aaron

    Please help. asp:hyperlink

    Aaron, Apr 29, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    2,184
    Matt Berther
    Apr 29, 2004
  2. davetichenor
    Replies:
    1
    Views:
    858
    Eliyahu Goldin
    Oct 30, 2006
  3. Ken
    Replies:
    1
    Views:
    396
    Alvin Bruney
    Aug 16, 2003
  4. Dave
    Replies:
    0
    Views:
    970
  5. Simon Dingley

    Help Required with asp:hyperlink controls

    Simon Dingley, Jan 13, 2005, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    100
    Simon Dingley
    Jan 13, 2005
Loading...

Share This Page