Struggling with page redirect based on radio button andform..?

Ask a Question related to Dreamweaver AppDev, Design and Development.

  1. #1

    Default Struggling with page redirect based on radio button andform..?

    Hi - using ASP/ACCESS/VB Script

    Have been struggling on this for days no, so I need som help please;

    Have a form with 2 radio buttons - se below.
    If radio button 2 is selected and imagefield submit clicked, then submit all
    form variables to testpage 2.
    If button 1 is selected and imagefield submit clicked, then only redirect to
    testpage 1.

    How can this be done??

    Here is my form;
    <form name="FormName" method="POST"
    action="https://secure.contopronto.com/webshop/pay.aspx">
    <div align="left">
    <table width="579">
    <tr>
    <td colspan="2" class="tekst12bla"><label>
    <input type="radio" name="1" value="Faktura">
    Postoppkrav</label></td>
    </tr>
    <tr>
    <td width="122" height="22" class="tekst12bla"><label>
    <input type="radio" name="2" value="Luup">
    <a href="http://www.luup.com" target="_blank"><img
    src="/bilder/sig_small_luuplogo.gif" width="60" height="20" border="0"
    align="absmiddle"></a></label></td>
    <td width="445" class="tekst12bla"><span
    class="tekst10bla">LUUP er en elektronisk lommebok som kan inneholde b&aring;de
    penger og kort.</span></td>
    </tr>
    </table>
    <p><input name="ShopID" value="Testshop" type="hidden">
    <input name="Language" value="NO" type="hidden">
    <input name="OrderID" value="<%=Session.SessionID%>"
    type="hidden">
    <input name="Amount"
    value=<%=Replace(WA_eCart_GrandTotal(testshop),"," ,".")%> type="hidden">
    <input name="Currency" value="NOK" type="hidden">
    <input name="OrderName" value="testshop - ordre"
    type="hidden">
    <input name="InfoTotal" value="0" type="hidden">
    <input name="UrlOk"
    value="http://www.testshop.no/asp/ordrebekreftelse_cp.asp" type="hidden">
    <input name="UrlCancel"
    value="http://www.testshop.no/asp/ordrebekreftelse.asp" type="hidden">
    <input name="UrlLogo"
    value="http://www.testshop.no/bilder/Steggen.gif" type="hidden">
    <input name="NotificationType " value="1" type="hidden">
    <input name="ResponseType" value="0" type="hidden">
    </p>
    <p>
    <input name="imageField" type="image"
    src="/bilder/knapp_sendbestilling.gif" align="bottom" width="117" height="20"
    border="0">
    </p>
    </div>
    </form>

    Best regards,

    Bjorn.

    btn Guest

  2. Similar Questions and Discussions

    1. Radio Button Options in Dynamic ASP Page
      I had a Dreamweaver "Behaviors question" for a survey I was working on. Please see survey link below:...
    2. radio and redirect
      Why mine code ins't work?, did I do anthing incorrect here? Thanks <script language="javascript"> function redirect() if page="add" {...
    3. Redirect and pass form variables based on radio buttonselection?
      Hi - using ASP/Access/VB Have a radio group with to radio buttons. If button 1 is selected - then pass the form variables and go to page 1 If...
    4. Redirect Based on What They Typed In
      Imagine your web hosting provider just permitted you to type *.mydomain.com and you still get to the mydomain.com website that they host for you....
    5. redirect to another page based on text in the URL of the current page
      Hi JPElectron, You were looking good until you got to the code. You're trying to use client-side code for your redirects, when you should be...
  3. #2

    Default Re: Struggling with page redirect based on radio button and form..?

    At present if the button is clicked then the visitor will go to
    [url]https://secure.contopronto.com/webshop/pay.aspx[/url]. It is on that page that you
    need to detect which radio button was clicked and handle the redirections.
    Basically you would us an IF/Else statement.

    --
    Regards

    Paul Whitham
    Macromedia Certified Professional for Dreamweaver MX2004
    Valleybiz Internet Design
    [url]www.valleybiz.net[/url]

    Team Macromedia Volunteer for Ultradev/Dreamweaver MX
    [url]www.macromedia.com/support/forums/team_macromedia[/url]

    "btn" <webforumsuser@macromedia.com> wrote in message
    news:d556uk$jt7$1@forums.macromedia.com...
    > Hi - using ASP/ACCESS/VB Script
    >
    > Have been struggling on this for days no, so I need som help please;
    >
    > Have a form with 2 radio buttons - se below.
    > If radio button 2 is selected and imagefield submit clicked, then submit
    all
    > form variables to testpage 2.
    > If button 1 is selected and imagefield submit clicked, then only redirect
    to
    > testpage 1.
    >
    > How can this be done??
    >
    > Here is my form;
    > <form name="FormName" method="POST"
    > action="https://secure.contopronto.com/webshop/pay.aspx">
    > <div align="left">
    > <table width="579">
    > <tr>
    > <td colspan="2" class="tekst12bla"><label>
    > <input type="radio" name="1" value="Faktura">
    > Postoppkrav</label></td>
    > </tr>
    > <tr>
    > <td width="122" height="22"
    class="tekst12bla"><label>
    > <input type="radio" name="2" value="Luup">
    > <a href="http://www.luup.com" target="_blank"><img
    > src="/bilder/sig_small_luuplogo.gif" width="60" height="20" border="0"
    > align="absmiddle"></a></label></td>
    > <td width="445" class="tekst12bla"><span
    > class="tekst10bla">LUUP er en elektronisk lommebok som kan inneholde
    b&aring;de
    > penger og kort.</span></td>
    > </tr>
    > </table>
    > <p><input name="ShopID" value="Testshop" type="hidden">
    > <input name="Language" value="NO" type="hidden">
    > <input name="OrderID" value="<%=Session.SessionID%>"
    > type="hidden">
    > <input name="Amount"
    > value=<%=Replace(WA_eCart_GrandTotal(testshop),"," ,".")%> type="hidden">
    > <input name="Currency" value="NOK" type="hidden">
    > <input name="OrderName" value="testshop - ordre"
    > type="hidden">
    > <input name="InfoTotal" value="0" type="hidden">
    > <input name="UrlOk"
    > value="http://www.testshop.no/asp/ordrebekreftelse_cp.asp" type="hidden">
    > <input name="UrlCancel"
    > value="http://www.testshop.no/asp/ordrebekreftelse.asp" type="hidden">
    > <input name="UrlLogo"
    > value="http://www.testshop.no/bilder/Steggen.gif" type="hidden">
    > <input name="NotificationType " value="1"
    type="hidden">
    > <input name="ResponseType" value="0" type="hidden">
    > </p>
    > <p>
    > <input name="imageField" type="image"
    > src="/bilder/knapp_sendbestilling.gif" align="bottom" width="117"
    height="20"
    > border="0">
    > </p>
    > </div>
    > </form>
    >
    > Best regards,
    >
    > Bjorn.
    >

    Paul Whitham TMM Guest

  4. #3

    Default Re: Struggling with page redirect based on radio buttonand form..?

    Hi.

    Thanx for reply.

    My problem is that I cant put my IF/ELSE code on this page because it is on a
    secure server that belongs to a payment gateway.
    I need to get this done one the page that is attached.

    Can I use 2 forms on my page,
    If radio 1 clicked then submit form 1
    If radio 2 clicked, then submit form 2

    IS this an idea? How?

    Bjorn.

    btn Guest

  5. #4

    Default Re: Struggling with page redirect based on radio button and form..?

    Bjorn

    While two forms are possible they would require two buttons so they are not
    the answer to your problem. The radio button does not have a value if it is
    not submitted so an inpage test is not available.

    You are going to have to action the form to a second page. At the very start
    of it have the IF statement that contains the test that will result is no
    action but a redirect. Something like this

    <%
    if request.Form("radiobutton") = "b" then
    reponse.redirect ("page2.asp")
    End if
    %>

    Then copy all the form elements from the first page that need to go to the
    gateway, but set their types to hidden and values to be
    <%request.form("fieldname")%>. The form does not need a button but it does
    need a name

    Then modify the body tag by adding the following
    onload="document.formname.submit();"



    --
    Regards

    Paul Whitham
    Macromedia Certified Professional for Dreamweaver MX2004
    Valleybiz Internet Design
    [url]www.valleybiz.net[/url]

    Team Macromedia Volunteer for Ultradev/Dreamweaver MX
    [url]www.macromedia.com/support/forums/team_macromedia[/url]

    "btn" <webforumsuser@macromedia.com> wrote in message
    news:d56c0f$c1u$1@forums.macromedia.com...
    > Hi.
    >
    > Thanx for reply.
    >
    > My problem is that I cant put my IF/ELSE code on this page because it is
    on a
    > secure server that belongs to a payment gateway.
    > I need to get this done one the page that is attached.
    >
    > Can I use 2 forms on my page,
    > If radio 1 clicked then submit form 1
    > If radio 2 clicked, then submit form 2
    >
    > IS this an idea? How?
    >
    > Bjorn.
    >

    Paul Whitham TMM Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139