Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 08-01-2007, 05:32 AM   PM User | #1
Everlongdrummer
New Coder

 
Join Date: Feb 2007
Posts: 33
Thanks: 2
Thanked 0 Times in 0 Posts
Everlongdrummer is an unknown quantity at this point
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
Everlongdrummer is offline   Reply With Quote
Old 08-01-2007, 06:15 AM   PM User | #2
fl00d
Regular Coder

 
Join Date: Mar 2007
Location: Quebec
Posts: 261
Thanks: 6
Thanked 7 Times in 7 Posts
fl00d has a little shameless behaviour in the past
I think this is a task suited for PHP.
fl00d is offline   Reply With Quote
Old 08-01-2007, 07:08 AM   PM User | #3
Everlongdrummer
New Coder

 
Join Date: Feb 2007
Posts: 33
Thanks: 2
Thanked 0 Times in 0 Posts
Everlongdrummer is an unknown quantity at this point
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.
Everlongdrummer is offline   Reply With Quote
Old 08-01-2007, 08:45 AM   PM User | #4
yeti
New Coder

 
Join Date: Jun 2006
Location: Graz, Austria
Posts: 81
Thanks: 2
Thanked 1 Time in 1 Post
yeti is an unknown quantity at this point
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
yeti is offline   Reply With Quote
Old 08-01-2007, 11:11 AM   PM User | #5
Everlongdrummer
New Coder

 
Join Date: Feb 2007
Posts: 33
Thanks: 2
Thanked 0 Times in 0 Posts
Everlongdrummer is an unknown quantity at this point
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>
Everlongdrummer is offline   Reply With Quote
Old 08-01-2007, 12:40 PM   PM User | #6
Pyrofire
New Coder

 
Join Date: Jan 2007
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Pyrofire is an unknown quantity at this point
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
Pyrofire is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 12:58 PM.


Advertisement
Log in to turn off these ads.