Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    New Coder
    Join Date
    Feb 2007
    Posts
    33
    Thanks
    2
    Thanked 0 Times in 0 Posts

    HTML Form linking to Pages

    Hey all,

    HTML forms are unfortunately one of my weaknesses. Currently I am working on a ordering system that requires the user to select an option from a drop down menu, which then navigates to a new page with a different option, eventually reaching an end price in which they can then pay through Paypal.

    Depending on what the user selects dictates which area of the ordering navigation they are taken to. It's a pretty simple concept.

    What I'd like to know, is how to code it so that when the user selects an option from a drop-down menu, then clicks a "Next" button, they are taken to a different page in relation to what selection they chose. For EG - they choose their country, and then the "Next" button will take them to a specific page for that country where they can then continue ordering.

    If this is too hard, then at least I would like to know how to code the drop-down menu so that when an option is selected then it automatically links them to the corresponding page.

    Hope this is easy enough to do......... many thanks in advance

  • #2
    Regular Coder
    Join Date
    Mar 2007
    Location
    Quebec
    Posts
    261
    Thanks
    6
    Thanked 7 Times in 7 Posts
    I think this is a task suited for PHP.

  • #3
    New Coder
    Join Date
    Feb 2007
    Posts
    33
    Thanks
    2
    Thanked 0 Times in 0 Posts
    ok i figured out how to link to pages straight from the drop down selection.

    im yet to find a way to do the same thing but via a Next button after selecting an option from the menu.

  • #4
    New Coder
    Join Date
    Jun 2006
    Location
    Graz, Austria
    Posts
    81
    Thanks
    2
    Thanked 1 Time in 1 Post
    Quote Originally Posted by Everlongdrummer View Post
    ok i figured out how to link to pages straight from the drop down selection.
    Fine! Can you please tell us how it is done, so that others can learn something too.
    webmaster and member of
    http://cashfromchaos.net

  • #5
    New Coder
    Join Date
    Feb 2007
    Posts
    33
    Thanks
    2
    Thanked 0 Times in 0 Posts
    Haha yeah sorry I was busy messing around with it.

    All I did was include the following javascript in the <head>

    <script type="text/javascript">
    function goToPage(dd) {
    var ind = dd.selectedIndex;
    if (ind == 0) { return; }
    var url = dd.options[ind].value
    document.location=url;
    }
    </script>

    And my drop down menu looks like this:

    <select name="country" id="country" onChange="goToPage(this); return false;">
    <option value="-" selected class="i" title="Country">- Please Choose -</option>
    <option value="../paypal/uk/steptwo.php">UK</option>
    <option value="http://www.google.com">Ireland</option>
    <option value="1" class="i3" title="USA">USA / Canada</option>
    <option value="3" class="i4" title="Other">Other Countries</option>
    </select>

  • #6
    New Coder
    Join Date
    Jan 2007
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts
    there are multiple ways to link forms over a number of pages, such as using session, and/or cookie functions in a server-side language such as PHP or ASP


  •  

    Posting Permissions

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