Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Drop-down list

Status
Not open for further replies.

manj

Programmer
Sep 22, 2000
28
0
0
GB
I have a drop-down box with various options. The question is how do I direct the user to the desired page when they select a particular option. I have copied some of the code below but it doesn't work. Any help please.

SCRIPT LANGUAGE="JavaScript">

<!-- JavaScript begins...

function jump (page) {
//alert(page);
window.location = page;
}

// JavaScript ends -->

</SCRIPT>


In body section:

<form action=&quot;search.cfm&quot; name=&quot;skip&quot;>
<SELECT NAME=&quot;page&quot; onChange = &quot;jump (document.skip.page.options[page.selectedIndex].value)&quot;>
<cfoutput query=&quot;get_style&quot;>
<option value=&quot;tour1.cfm&quot;>#get_style.style_name#</option>
</cfoutput>
</select>
</form>

 
Hi!

It's hard to debug without knowing the error but try this:

<form action=&quot;search.cfm&quot; name=&quot;skip&quot;>
<SELECT NAME=&quot;page&quot; onChange = &quot;jump (this.options[this.selectedIndex].value)&quot;>
<cfoutput query=&quot;get_style&quot;>
<option value=&quot;tour1.cfm&quot;>#get_style.style_name#</option>
</cfoutput>
</select>
</form>

Chris ;-)

 
Thanks onirike - it worked.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top