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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Listbox Navigation

Navigation

Listbox Navigation

by  webmigit  Posted    (Edited  )
I don't understand a lot of javascript, as matter of fact, this is my first if statement done by myself so.. I'll just give you the code.

Code:
<script>
<!--
  function goNav(itid,comp) {
    if(comp == 0) {
      // Do nothing
    } else {
      parent.main.location=itid;
    }
  }
-->
</script>

Your onchange attribute for the list/menu is:

Code:
onchange="goNav('vd.html?id='+document.conav.coID.options[document.conav.coID.selectedIndex].value,document.conav.coID.options[document.conav.coID.selectedIndex].value);"

conav is the form name, must be exact case.
coID is the select box name, must be the exact same case.

That's... pretty much it...

You can change the main in parent.main.location to your frame name, if its the same window, change parent.main.location to window.location.
Register to rate this FAQ  : BAD 1 2 3 4 5 6 7 8 9 10 GOOD
Please Note: 1 is Bad, 10 is Good :-)

Part and Inventory Search

Back
Top