Moderators: Derry, Goldie, Harpo
Go
New
Find
Notify
Tools
Reply
  
-star Rating Rate It!  Login/Join 
Junior Mechanic
Posted
Hello, I'm new (in case you won't be able to tell after reading this!).
I've created a dropdown list that consists of Week1, Week2, Week3, etc... I assume someone can select a week and it will change to the respective page.
Am I right when I assume I have alot to learn about codes? Or is it a matter of plugging in the right values or methods?
I promise to be a good student! Probably just going to be a slowwwww start ^_^
 
Posts: 2 | Registered: October 21, 2006Reply With QuoteEdit or Delete MessageReport This Post
Honorary Mechanic
Picture of Bailey
Posted Hide Post
One way to create a drop down list that will take visitors to the chosen page is as follows:
Place the following code as a Custom Header, using the Page Editor in SS.

<SCRIPT TYPE="text/javascript">
<!--
function dropdown(mySel)
{
var myWin, myVal;
myVal = mySel.options[mySel.selectedIndex].value;
if(myVal)
{
if(mySel.form.target)myWin = parent[mySel.form.target];
else myWin = window;
if (! myWin) return true;
myWin.location = myVal;
}
return false;
}
//-->
</SCRIPT>

Next, add the following to your page, as a code object.
<FORM
ACTION="../cgi-bin/redirect.pl"
METHOD=POST onSubmit="return dropdown(this.gourl)">
<SELECT NAME="gourl">
<OPTION VALUE="">Choose a Destination..
<OPTION VALUE="yourpagename.html" >mypage
<OPTION VALUE="yourpagename.html" >mypage2
<OPTION VALUE="yourpagename.html" >mypage3
</SELECT>
<INPUT TYPE=SUBMIT VALUE="Go">
</FORM>

Edit the text highlighted in bold to your requirements. You can add as many <OPTION VALUE="blah" lines as you need.
Hope this helps
 
Posts: 690 | Location: Perth Australia (ex Wales) | Registered: June 23, 2005Reply With QuoteEdit or Delete MessageReport This Post
Guru 'Power' Mechanic
Picture of Bruceee
Posted Hide Post
Another way is to use the built-in Selection List (a Form element). See Help > Tutorials > Form Introduction.
 
Posts: 9269 | Location: Wellington, New Zealand | Registered: December 11, 2003Reply With QuoteEdit or Delete MessageReport This Post
Junior Mechanic
Posted Hide Post
Hey you guys are great... thanks for the replies. I haven't even tried your advice yet. I'll let you know when "I git smarter".^_^
 
Posts: 2 | Registered: October 21, 2006Reply With QuoteEdit or Delete MessageReport This Post
Junior Mechanic
Picture of ZERO D.U.I
Posted Hide Post
Hello there, I see this was posted a while back(Oct, 2006) But I'm having the same problem and I tried to follow both options given in this topic, but I couldn't get it to work. I'd like to link each entry on the dropdown list to an specific page (eg.. Choose city and State) and if they choose San Francisco, CA or Miami, FL then take them to that page
 
Posts: 2 | Registered: August 25, 2009Reply With QuoteEdit or Delete MessageReport This Post
Honorary 'Aussie' Mechanic
Picture of postyr
Posted Hide Post
Hi Zero, and welcome to the forum.

The examples above apply to a form selection list that is based on one selection only.

That is, a list of states, or a list of cities. If you select a city in one list, it will take you to that city’s page. If you click on a state in another list, it will take you to that page.

If you want to redirect to a page based on a combination of both choices, that becomes a little more involved.

You would either need some code (such as javascript or PHP), or a database, such as MySql. The latter choice can be used in conjunction with PHP if your server supports it.

If you list is compiled by city and state on one line, such as “Miami, FL”, then the first option is (or should be) simple.

In either case, please explain exactly what you would like to achieve, and what problems you are having so far.

I’m sure someone on the forum here will be ready to lend a hand.
 
Posts: 1167 | Location: Australia | Registered: April 17, 2007Reply With QuoteEdit or Delete MessageReport This Post
Honorary 'Creative' Mechanic
Picture of Klimt
Posted Hide Post
I think that this tutorial describes what you want to achieve.
 
Posts: 1753 | Location: Vienna, Austria | Registered: July 17, 2006Reply With QuoteEdit or Delete MessageReport This Post
Junior Mechanic
Picture of ZERO D.U.I
Posted Hide Post
Hey thanks guys, but I'm not able to get this feature to work for me. I guess I'm not understanding what the "Values" are. if each value links the name to an action, or page, then I guess that's what I'm not getting.

In my case what I'm trying to achieve is for the visitor to choose only one option from the dropdown list. I want to put this feature in the very first page or welcome page. I'd like to have it set where it shows as defult "Choose your City and State". Then, when they click on the dropdown arrow it shows them the locations where our service is available(e.g. Seattle, WA, or Portland,OR) so once they select their location I want to re-direct them to that specific "page" that shows the info and features available at location. If they are in Alaska, that option won't be available becasue our service is not establish there.
 
Posts: 2 | Registered: August 25, 2009Reply With QuoteEdit or Delete MessageReport This Post
Guru 'Power' Mechanic
Picture of Bruceee
Posted Hide Post
The Drop-Down List Values window, illustrated in the tutorial, has two parts: Name and Value.

The Name is the name in the Drop-Down that visitor will see and select from. The Value is the URL of the page the browser will jump to.

So you might have:
Name: Seattle (your visitor clicks this to select)
Value: SeattlePage.html (the name of an actual page in your project, not forgetting the .html part)

Also, check out menus with selection lists -- that has a working example.
 
Posts: 9269 | Location: Wellington, New Zealand | Registered: December 11, 2003Reply With QuoteEdit or Delete MessageReport This Post
  Powered by Eve Community  
 


™ & © 1998 - 2008, Virtual Mechanics Inc. All rights reserved.