Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Next and previous buttons associated with drop down list

MrMuggles31MrMuggles31 Member Posts: 1
This question really should be an easy one to answer, but for the life of me, I cannot figure out what to search for in Google, nor how to code it. Here is the situation -
I have an HTML file that has a JavaScript drop down list. The JavaScript file is:
[code]function menu_goto( menuform )
{
var baseurl = 'http://www.cnn.com/' ;
selecteditem = menuform.url.selectedIndex ;
newurl = menuform.url.options[ selecteditem ].value ;
if (newurl.length != 0) {
location.href = baseurl + newurl ;
}
}
document.writeln( '' );
document.writeln( '' );
document.writeln( 'First' );
document.writeln( 'Second' );
document.writeln( 'Third' );
document.writeln( 'Fourth' );
document.writeln( 'Fifth' );
document.writeln( '' );
document.writeln( '' );
[/code]
Pretty simple stuff. The HTML file just has this JS added where I want the drop down to show up.
The question is - now that I have a drop down list, how can I add a Next, Previous, and Home button that goes to the next or previous option on the list, or to the first option when the user clicks Home? So if the user is on Third, they would click on Next, it would go to Fourth, click on previous it would go to Second, or click Home and it would go to First. Obviously putting goforward or goback would not work because that would put the user forward or back based on there browsing history. I want it to be tied into the list. Any ideas? Any websites I can visit that has a good example of this? I am hoping the issue is an easy solution. Thank you all in advance.
Sign In or Register to comment.