?
Solved

How to auto launch a new page based on selection from a select (drop-down) box without a submit button

Posted on 2005-03-02
5
Medium Priority
?
158 Views
Last Modified: 2010-04-09
I think my question title says it all, but to put it another way -- how do I code a page so that a new page is automatically launched when a user selects from a drop-down rather than making the selection then hitting "submit".

Thanks.
0
Comment
Question by:scottie_24
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
5 Comments
 
LVL 32

Accepted Solution

by:
Batalf earned 1000 total points
ID: 13444581
<select onchange="if(this.options[this.selectedIndex].value.length>0)location.href=this.options[this.selectedIndex].value">
<option value=""></option>
<option value="page1.html">page 1</option>
<option value="page2.html">page 2</option>
<option value="page3.html">page 3</option>
</select>
0
 
LVL 37

Expert Comment

by:Harisha M G
ID: 13444623
Here is a DreamWeaver created sample page....

<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="JavaScript">
<!--
function jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
//-->
</script>
</head>

<body bgcolor="#FFFFFF" text="#000000">
<form name="form1">
  <select name="menu1" onChange="jumpMenu('parent',this,0)">
    <option value="site1.com" selected>Site Description1</option>
    <option value="site2.com">Site Description2</option>
  </select>
</form>
</body>
</html>
0
 
LVL 32

Expert Comment

by:Batalf
ID: 13444655
My solution is the "notepad" solution:-)
0
 

Author Comment

by:scottie_24
ID: 13444656
Thanks Batalf. I gotta give the points to the first correct answer, sorry mgh_mgharish.
0
 
LVL 32

Expert Comment

by:Batalf
ID: 13444661
Thank you!

Batalf
0

Featured Post

WordPress Tutorial 1: Installation & Setup

WordPress is a very popular option for running your web site and can be used to get your content online quickly for the world to see. This guide will walk you through installing the WordPress server software and the initial setup process.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
Q&A with Course Creator, Mark Lassoff, on the importance of HTML5 in the career of a modern-day developer.
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question