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!

Select HREF OnChange or Submit

Status
Not open for further replies.

NoWizod

Technical User
Apr 27, 2007
9
0
0
US
I have a drop-down list of different links to pages within the application, is there a way to code this so I can follow the link OnChange or via a Submit button without using JavaScript?
I have tried several different ways and even though the correct option is selected it's not active.
Here are a few of the things I've tried with no luck...
Code:
<select onChange="href=#value#">
	<option value="insertProductScreen1.cfm">Add New Product</option>
	<option value="changeProductScreen1.cfm">Change a Product's Info</option>

Code:
<select onChange="href=this.value">
	<option value="insertProductScreen1.cfm">Add New Product</option>
	<option value="changeProductScreen1.cfm">Change a Product's Info</option>

Code:
<select name="action">
	<option value="insertProductScreen1.cfm">Add New Product</option>
	<option value="changeProductScreen1.cfm">Change a Product's Info</option>

<input type="submit" value="Continue" name="a href=<cfoutput>#action#</cfoutput>">

I feel as though something to this effect should work, however OnAction seems to do nothing, and submit shows a browser request, but refreshes my page. Any thoughts on this one??
 
Have you tried:

Code:
<select onChange="window.location=this.value">

Why don't you want to use javascript anyway? you are using an event handeler with the onChange etc!

Hope this helps!

Tony
 
WOW.. THANKS!!! It's not that I really didn't want to use JavaScript, but I figured that it could be easily done with a one liner like you supplied. I just couldn't get it to go.
Thanks again!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top