It appears you have not yet registered with DEVPPL. To register please click here... (it's fast, easy and free!)

Forum

Log In Sponsors
Board index Programming HTML Forum

auto submit with <select> tag...

auto submit with <select> tag...

Postby dtvonly on Thu Nov 16, 2006 12:59 am

How do I perform an automatic submit once an item in a drop-down menu is selected? thank you
dtvonly
 
Posts: 4
Joined: Thu Nov 16, 2006 12:56 am

Postby webmaster on Thu Nov 16, 2006 5:47 am

Hi and welcome to DEVPPL

Add this within the <head> - </head> tags:
Code: Select all
<script language="JavaScript">
<!--
function MM_jumpMenu(targ,selObj,restore){ //v3.0
eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
if (restore) selObj.selectedIndex=0;
}
//-->
</script>


Try this:
Code: Select all
<form>
   <select name="meny" onChange="MM_jumpMenu('parent',this,1)">
      <option selected>Choose!</option>
      <option value="../1.html">1</option>
      <option value="../2.html">2</option>
      <option value="../3.html">3</option>
   </select>
</form>
Make sure to check out our TNX Review and Link Vault Review
User avatar
webmaster
Site Admin
 
Posts: 2695
Joined: Tue Aug 17, 2004 1:07 pm
Location: Sweden


Who is online

Users browsing this forum: No registered users and 8 guests