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 6 of 6
  1. #1
    New to the CF scene
    Join Date
    Jan 2007
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Unhappy Jump Menu Script Problem

    Hi,

    I am having a problem with getting jump menus to reset themselves to the <option selected> value.

    Here is the code format I am using:

    <tr>
    <form name="dammit">
    <td>
    <select name="dammit1" onChange="location=this.options[this.selectedIndex].value; document.dammit.reset()" value="GO">
    <option selected>&nbsp;BLAH BLAH</option>
    <option value="blah blah">&nbsp;blah blah</option>
    <option value="blah blah">&nbsp;blah blah</option>
    <option value="blah blah">&nbsp;blah blah</option>
    </select>
    </td>
    </form>
    <tr>

    Now the problem is, that I have a number of these jump menus on one page (http://www.eventpolynesia.com/indexspg77.htm), all with the exact same code format (except <form name> & <select name> values, which are unique for each jump menu) - some of these menus reset themselves with no problem, but some of them do not reset (preview testing inside FrontPage gives a 'document is null of not an object' error for the menus that do not reset).

    It's driving me crazee - why do some work and others not

    If anyone could help with this code, or suggest a better jump menu script, I would be very grateful

    TIA,

    Dave

  • #2
    Regular Coder
    Join Date
    Feb 2005
    Posts
    679
    Thanks
    0
    Thanked 16 Times in 15 Posts
    Since the reset occurs after the location is initiated, I suspect the document is 'history' before it is reset.
    Try:
    Code:
    onChange="loc=this.options[this.selectedIndex].value; document.m1.reset();location.href=loc;"

  • #3
    New to the CF scene
    Join Date
    Apr 2006
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by rwedge View Post
    Since the reset occurs after the location is initiated, I suspect the document is 'history' before it is reset.
    Try:
    Code:
    onChange="loc=this.options[this.selectedIndex].value; document.m1.reset();location.href=loc;"
    Yes, I think it should work.

    good luck

  • #4
    New to the CF scene
    Join Date
    Jan 2007
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Not a javascript coding issue afterall?

    Thanks for replying,

    I used the code you sent, and it works fine on the jump menus that were already resetting themselves, but not on the ones that were not resetting themselves...

    Now I know that it the fault is not the javascript itself, but rather something screwy going on with my table layout I guess. I have been over the code time after time, but cannot spot what is wrong - I have cut-n-pasted code from working jump menus into the <tr> which houses the jump menus that are not working, but it will not work after being pasted into the problematic <tr>

    Short of restructuring all nested tables on my homepage http://www.eventpolynesia.com/ (in the hope that whatever glitch is happening now will not reoccur), I have no idea how to resolve this issue

    Thank you very much for taking the time to help me out; I really appreciate your help.

  • #5
    Regular Coder
    Join Date
    Feb 2005
    Posts
    679
    Thanks
    0
    Thanked 16 Times in 15 Posts
    HTML is causing the error, you forgot the closing </form> tag for the m3 through m7 forms.
    That is what fails in FF, in IE, however, none of the forms reset. The alternative I posted should work in both browsers.
    Last edited by rwedge; 07-20-2007 at 01:05 AM. Reason: BTW: The is no 'value' attribute for a select tag

  • #6
    New to the CF scene
    Join Date
    Jan 2007
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Smile Awesome!

    You should be promoted from 'regular coder' to 'legend' sir;
    I cannot thank you enough for taking the time to help me with my problem, and for providing me with a solution

    Live long and prosper!


  •  

    Posting Permissions

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