Click to See Complete Forum and Search --> : anyone know how to make a 'jump-to-menu' with multiple options?


rachelturner
07-09-2003, 06:51 AM
Hi there
I am trying to do the following with no luck:

I want to have a form with two select menus. Each menu will obvisouly have different options, each with its own value. Then quite simply, when the user clicks on the submit button, I want the resulting URL to include options from the select fields ( ie: whatever the user has selected.)

For eg: for a date URL, the final URL might be:

'http://www.comics.com/' +day+ '/' +month+ '/garfield.gif'

Hope this makes sense, and appreciate any assistance.

Thanks,
Rachel

:confused:

pyro
07-09-2003, 07:21 AM
Try something like this:

<html>
<head>

<script type="text/javascript">
function loadPage(frm) {
day = frm.day.options[frm.day.selectedIndex].value;
month = frm.month.options[frm.month.selectedIndex].value;
window.location.href = "http://www.comics.com/"+day+"/"+month+"/garfield.gif";
return false;
}
</script>

</head>

<body>
<form name="jumpform" onsubmit="return loadPage(this);">
<select name="day">
<option value="sunday">Sunday</option>
<option value="monday">Monday</option>
</select>
<select name="month">
<option value="january">January</option>
<option value="february">February</option>
</select>
<input type="submit" value="Submit">
</form>
</body>
</html>

rachelturner
07-09-2003, 08:04 AM
Thanks - It's ever so kind of you to reply and so quickly!

On a completely different note, I used to live in Wisconsin also - whereabouts are you from? I used to live in Madison.

pyro
07-09-2003, 10:12 AM
I live about 3 hrs. north of that, in Minocqua. Ever heard of it?