Pulll Down menu referencing a list

This is a discussion on "Pulll Down menu referencing a list" within the Web Page Design section. This forum, and the thread "Pulll Down menu referencing a list are both part of the Design Your Website category.


 Subscribe in a reader

Go Back   Webforumz.com > Main Forums > Design Your Website > Web Page Design

Notices




Reply
 
LinkBack (2) Thread Tools
  2 links from elsewhere to this Post. Click to view. #1  
Old Feb 23rd, 2008, 11:04
New Member
Join Date: Feb 2008
Location: Canada
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Pulll Down menu referencing a list

This is the code I am using at the moment for my pull down menu. It works great. I was wondering if it is possible to have the pull down menu reference a list file instead of entering each item separately like I did below. The reason is that if I make changes to the list file, it will be easier for me to maintain the pull down menu. Especially if I have the drop down code appearing on several pages on my web site.

Right now if I made a change to my links below and I have this code in three separate pages on my web site, I would have to make three separate changes. If I had my pull down menus referencing the same list file, then all I would have to do is make changes to that list file and all of my three pull down menus would reflect the changes made.

I know that there must me an answer to this question. Thanks!!


<select name="select15" onChange="window.open(this.options[this.selectedIndex].value,'_blank')"" style="width: 100%;">
<option selected>MUSIC</option>
<option value="http://www.apple.com/">Apple</option>
<option value="http://www.nfo.net/">Big Band database</option>
<option value="http://www.ottawacarsija.com/"">Bosnian Radio</option>
<option value="http://www.chuo.fm"">CHUO-FM</option>
<option value="http://www.classicmoviemusicals.com"">Classic Movie Musicals</option>
<option value="http://www.downbeat.com"">Downbeat Magazine</option>
<option value="http://www.drummerworld.com"">Drummerworld</option>
<option value="http://www.inamellowtone.blogspot.com/"">In A Mellow Tone</option>
<option value="http://www.jazz.com/"">Jazz</option>
<option value="http:/www.jazzreview.com/"">Jazz Review</option>
<option value="http:/www.jazzstandards.com/"">Jazz Standards</option>
<option value="http://www.musicweb-international.com/RiseandFall/index.htm"">Popular Music</option>
<option value="http:/www.redhotjazz.com/"">Red Hot Jazz Archive</option>
<option value="http://www.songwritershalloffame.org/"">Songwriters Hall Of Fame</option>
<option value="http://www.touchemusic.se/"">Touche Music</option>
</select>
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote

  #2  
Old Feb 23rd, 2008, 11:09
Jack Franklin's Avatar
Moderator

SuperMember
Join Date: May 2007
Location: Cornwall, England
Posts: 1,408
Blog Entries: 8
Thanks: 18
Thanked 14 Times in 14 Posts
Re: Pulll Down menu referencing a list

You could use an include? SO on each page you have:
PHP: Select all

<?php include('dropdown.php'); ?>

And then in dropdown.php have:
Code: Select all
<select name="select15" onChange="window.open(this.options[this.selectedIndex].value,'_blank')"" style="width: 100%;">
<option selected>MUSIC</option>
<option value="http://www.apple.com/">Apple</option> 
<option value="http://www.nfo.net/">Big Band database</option> 
<option value="http://www.ottawacarsija.com/"">Bosnian Radio</option> 
<option value="http://www.chuo.fm"">CHUO-FM</option> 
<option value="http://www.classicmoviemusicals.com"">Classic Movie Musicals</option> 
<option value="http://www.downbeat.com"">Downbeat Magazine</option> 
<option value="http://www.drummerworld.com"">Drummerworld</option> 
<option value="http://www.inamellowtone.blogspot.com/"">In A Mellow Tone</option> 
<option value="http://www.jazz.com/"">Jazz</option> 
<option value="http:/www.jazzreview.com/"">Jazz Review</option> 
<option value="http:/www.jazzstandards.com/"">Jazz Standards</option> 
<option value="http://www.musicweb-international.com/RiseandFall/index.htm"">Popular Music</option> 
<option value="http:/www.redhotjazz.com/"">Red Hot Jazz Archive</option> 
<option value="http://www.songwritershalloffame.org/"">Songwriters Hall Of Fame</option> 
<option value="http://www.touchemusic.se/"">Touche Music</option>
</select>
And then when you needed to add an option you would change just the one file!
__________________
Jack Franklin - Webforumz Moderator
(x)HTML | CSS | PHP | MySQL | JQuery (Javascript)
Contact: My Blog | Twitter | Delicious
Want Lessons? PM me.
If you think I've helped, please press the 'Thanks' Button.
Last Blog Entry: A Week with VBulletin (Aug 28th, 2008)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3  
Old Feb 23rd, 2008, 11:16
New Member
Join Date: Feb 2008
Location: Canada
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Pulll Down menu referencing a list

Thanks for the quick reply!! Much appreciated. I am totally new to all this HTML stuff so I need a lot of hand holding. How do I create a dropdown.php file to hold all of my option values?

If you go to my web site (www.mcran.com), you will see at the bottom of my home page I have three pull down menus. These menus also appear in the sidebar of some of my other pages as well as at the bottom of my Interviews page.

If I understand correctly, All I have to do is create a php file for Music, one for computer, and the third for Shows each with their own .php file. Then all I have to do is update for example the Music.php file and all of my music pull down menus will reflect this change? If that is the case, this is exactly what I am looking for.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4  
Old Feb 23rd, 2008, 11:22
Jack Franklin's Avatar
Moderator

SuperMember
Join Date: May 2007
Location: Cornwall, England
Posts: 1,408
Blog Entries: 8
Thanks: 18
Thanked 14 Times in 14 Posts
Re: Pulll Down menu referencing a list

Yep. Take your drop down into the new PHP file, and were it was, put:
<?php include('file.php'); ?>

Noting that your pages must end with .php for thsi to work. Good luck, and any problems just post again
__________________
Jack Franklin - Webforumz Moderator
(x)HTML | CSS | PHP | MySQL | JQuery (Javascript)
Contact: My Blog | Twitter | Delicious
Want Lessons? PM me.
If you think I've helped, please press the 'Thanks' Button.
Last Blog Entry: A Week with VBulletin (Aug 28th, 2008)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #5  
Old Feb 23rd, 2008, 11:25
New Member
Join Date: Feb 2008
Location: Canada
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Pulll Down menu referencing a list

I am using a Mac so do I just have to go into a text editor, put the drop down info in there and save it as Music.php? That's it?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #6  
Old Feb 23rd, 2008, 11:39
Jack Franklin's Avatar
Moderator

SuperMember
Join Date: May 2007
Location: Cornwall, England
Posts: 1,408
Blog Entries: 8
Thanks: 18
Thanked 14 Times in 14 Posts
Re: Pulll Down menu referencing a list

Yep. Then add the include in your page. Good luck
__________________
Jack Franklin - Webforumz Moderator
(x)HTML | CSS | PHP | MySQL | JQuery (Javascript)
Contact: My Blog | Twitter | Delicious
Want Lessons? PM me.
If you think I've helped, please press the 'Thanks' Button.
Last Blog Entry: A Week with VBulletin (Aug 28th, 2008)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #7  
Old Feb 23rd, 2008, 12:15
New Member
Join Date: Feb 2008
Location: Canada
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Pulll Down menu referencing a list

Thanks! Does the for example music.php file have to reside in a specific location on my hard drive?

Thanks for understanding my concerns. I am so new to all this stuff.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #8  
Old Feb 23rd, 2008, 13:21
New Member
Join Date: Feb 2008
Location: Canada
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Pulll Down menu referencing a list

Is this acceptable syntax?

<?php*include('http://www.myserver.com/files/music.php');*?>
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #9  
Old Feb 23rd, 2008, 14:17
Jack Franklin's Avatar
Moderator

SuperMember
Join Date: May 2007
Location: Cornwall, England
Posts: 1,408
Blog Entries: 8
Thanks: 18
Thanked 14 Times in 14 Posts
Re: Pulll Down menu referencing a list

Almost there! Where have you got the * from!

<?php include('yourfile.php'); ?>
__________________
Jack Franklin - Webforumz Moderator
(x)HTML | CSS | PHP | MySQL | JQuery (Javascript)
Contact: My Blog | Twitter | Delicious
Want Lessons? PM me.
If you think I've helped, please press the 'Thanks' Button.
Last Blog Entry: A Week with VBulletin (Aug 28th, 2008)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Thread Tools

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
Trackbacks are On
Pingbacks are On
Refbacks are On

LinkBacks (?)
LinkBack to this Thread: http://webforumz.com/web-page-design/65501-pulll-down-menu-referencing-a-list.htm
Posted By For Type Date
Realmac Software / Question regarding pull down menus on more than one page This thread Refback Feb 23rd, 2008 11:33
Realmac Software / Question regarding pull down menus on more than one page This thread Refback Feb 23rd, 2008 11:29

Similar Threads
Thread Thread Starter Forum Replies Last Post
php/mysql database fields into html list/menu csun PHP Forum 4 Jul 27th, 2007 16:04
dropdown menu / list box amalafrida JavaScript Forum 5 Jul 27th, 2007 09:49
menu/list width question swiftmed Web Page Design 3 May 19th, 2006 13:05
Menu List. Select Multiple without Ctrl+Click? Andy K JavaScript Forum 7 May 10th, 2005 09:01
A way to change background color of a menu list gohankid77 Web Page Design 1 Oct 12th, 2004 10:14


All times are GMT. The time now is 03:29.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

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