Notices

Great community. Great ideas.

Welcome to ASP/Free, a community dedicated to helping beginners and professionals alike in improving their knowledge of Microsoft's development and administration technologies. Sign up today to gain access to the combined insight of tens of thousands of members.

Thread: Redirecting User Via Drop Down Box

Results 1 to 2 of 2
Share This Thread →
  1. #1
    minignaz is offline Registered User
    Join Date
    Dec 2004
    Posts
    1
    Rep Power
    0

    Redirecting User Via Drop Down Box

    Ive created a drop down box, and I want it, dependant on what the user has selected, redirect them to webpage.

    How do I go about setting this up?

  2. #2
    selwonk's Avatar
    selwonk is offline Contributing User
    Join Date
    Jun 2004
    Posts
    3,072
    Rep Power
    189
    Code:
    <html>
    <head>
    <title>Jump Menu Example</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <script language="JavaScript">
    <!--
    function MM_jumpMenu(targ,selObj,restore){ //v3.0
      eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
      if (restore) selObj.selectedIndex=0;
    }
    
    function MM_findObj(n, d) { //v4.0
      var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    	d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
      if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
      for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
      if(!x && document.getElementById) x=document.getElementById(n); return x;
    }
    
    function MM_jumpMenuGo(selName,targ,restore){ //v3.0
      var selObj = MM_findObj(selName); if (selObj) MM_jumpMenu(targ,selObj,restore);
    }
    //-->
    </script>
    </head>
    
    <body bgcolor="#FFFFFF" text="#000000">
    <form name="form1">
      <select name="JumpMenu1" onChange="MM_jumpMenu('parent',this,0)">
    	<option value="page1.asp" selected>Page 1</option>
    	<option value="page2.asp">Page 2</option>
    	<option value="page3.asp">Page 3</option>
      </select>
      <input type="button" name="Button1" value="Go" onClick="MM_jumpMenuGo('JumpMenu1','parent',0)">
    </form>
    </body>
    </html>
    http://www.MapDays.com | Find events wherever, whenever you want them


Share This Thread →

Become Part of This Conversation

Join NowFor Free!

Similar Threads

  1. Securing A Database
    By TBÁrpi in forum Microsoft Access Help
    Replies: 31
    Last Post: January 25th, 2005, 05:23 PM
  2. User Friendly form
    By dupati1 in forum HTML, JavaScript And CSS Help
    Replies: 0
    Last Post: October 31st, 2004, 08:33 AM
  3. SQL Query question...
    By LilMoke in forum SQL Development
    Replies: 3
    Last Post: June 16th, 2004, 09:23 AM
  4. redirecting the user after login
    By icepricessa in forum ASP Development
    Replies: 2
    Last Post: October 23rd, 2003, 09:24 AM

ASP Free Advertisers and Affiliates