homepage Welcome to WebmasterWorld Guest from 54.226.10.234
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
Forum Library, Charter, Moderator: open

JavaScript and AJAX Forum

    
drop down menu redirect
whatson

WebmasterWorld Senior Member 10+ Year Member



 
Msg#: 4523983 posted 9:48 pm on Nov 30, 2012 (gmt 0)

I want a simple drop down menu, and when an option is selected I want it to perform an action, e.g. redirect to a specific url.
How is this done?

 

Aaron99



 
Msg#: 4523983 posted 6:48 am on Dec 1, 2012 (gmt 0)

Yes through .htaccess you can redirect these urls and it's working fine here.

g1smd

WebmasterWorld Senior Member g1smd us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 4523983 posted 10:51 am on Dec 1, 2012 (gmt 0)

Why redirect (i.e. return 301 status)?

Why not just a straight link to the new URL?

whatson

WebmasterWorld Senior Member 10+ Year Member



 
Msg#: 4523983 posted 7:13 pm on Dec 1, 2012 (gmt 0)

Ok sure, I would rather not use a redirect, how do I do it without a redirect, or without using a submit button?

lexipixel

WebmasterWorld Senior Member 10+ Year Member



 
Msg#: 4523983 posted 9:33 pm on Dec 8, 2012 (gmt 0)


<html>
<head>
<title>URL Select</title>
<script type="text/javascript">
function goToUrl() {
var newurl;
newurl = document.getElementById('urlselector').value;
document.location.href = newurl;
}
</script>
</head>
<body>
<form>
<select id="urlselector" onchange="goToUrl();">
<option value="">- select -</option>
<option value="http://www.bing.com">Bing</option>
<option value="http://www.google.com">Google</option>
<option value="http://www.yahoo.com">Yahoo!</option>
</select>
</form>
</body>
</html>

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved