View Full Version : HTML Form linking to Pages

08-01-2007, 05:32 AM
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 :)

08-01-2007, 06:15 AM
I think this is a task suited for PHP.

08-01-2007, 07:08 AM
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.

08-01-2007, 08:45 AM
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.

08-01-2007, 11:11 AM
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

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>

08-01-2007, 12:40 PM
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