Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder tpeck's Avatar
    Join Date
    Oct 2002
    Location
    Sydney, Australia
    Posts
    859
    Thanks
    50
    Thanked 6 Times in 5 Posts

    externalize a page jumping routine

    Hi. Is there a way to externalize a page jumping routine such as the one the below? At the moment it has 100 options and exists on 100 pages:

    <form name="form">
    <select name="site" size="1" onchange="MM_jumpMenu('parent',this,0)">
    <option value>•••</option>
    <option value="page1.html">1</option>
    <option value="page2.html">2</option>
    <option value="page2.html">3</option>
    ....etc.
    </form>

    Thanks,

    Terry
    Last edited by tpeck; 10-17-2005 at 02:20 AM.

  • #2
    Regular Coder martin_narg's Avatar
    Join Date
    Jul 2002
    Location
    Chamonix, France
    Posts
    600
    Thanks
    1
    Thanked 3 Times in 3 Posts
    Your html page:
    Code:
    <form name="form">
    <select name="site" size="1" onchange="jump(this);">
    <option value>•••</option>
    <option value="page1.html">1</option>
    <option value="page2.html">2</option>
    <option value="page2.html">3</option>
    </form>
    Your external js page:
    Code:
    function jump(obj) {
      if(obj.selectedIndex > 0) {
        document.location.href = obj[obj.selectedIndex].value;
      }
    }
    hope this helps

    m_n
    "Cos it's strange isn't it. You stand in the middle of a library and go 'Aaaaaaaaaaaaaaaaggggggghhhhhhh!'
    and everybody just stares at you. But you do the same in an aeroplane, and everybody joins in."
    -Tommy Cooper

  • #3
    Regular Coder tpeck's Avatar
    Join Date
    Oct 2002
    Location
    Sydney, Australia
    Posts
    859
    Thanks
    50
    Thanked 6 Times in 5 Posts
    Yes, thanks - it's better than what I have at the moment, but it still requires a 100 lines (for the 100 pages) in each page.

    Is there no other option? I'll use what you've given me over my routine though.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •