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
    New to the CF scene
    Join Date
    Jul 2004
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    This works only once in Netscape 4.7/8, why?

    I've got a simple pull-down menu to help visitors navigate department pages. It works in Mozilla, Firefox, Netscape 7.x (all the Geckos), IE 5,5.5,6, etc., but in Netscape 4.7/8, the menu works once, but if you hit the "back" button and return to the page, the menu no longer functions.

    I've tried rewriting the code but nothing has worked. One thing, the <div></div> section is a necessary part of the code and I can't remove it, else something else breaks. If anyone can help me, I'd be very grateful. Thanks.


    Here is the code:

    ---IN <BODY> of document
    <div id=formdiv1 name=formdiv1 style="position:relative">
    <form name="adminform">
    <select name="select" onChange="MM_jumpMenu('parent',this,0)">
    <option selected>Education Directory</option>
    <option>--------------------------</option>
    <option value="/about.html">About Education Department</option>
    <option value="/calendar.html">Education Calendar 2004-05</option>
    <option value="/academics.html">Academics</option>
    <option value="/faculty.html">Education Faculty</option>
    </select>
    </form>
    </div>


    --In <HEAD> of document

    <script language="javascript" type="text/javascript">

    function MM_jumpMenu(targ,selObj,restore){ //v3.0
    eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
    if (restore) selObj.selectedIndex=0;
    }

    </script>

  • #2
    Senior Coder
    Join Date
    Feb 2004
    Location
    Edinburgh
    Posts
    1,352
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Arrow never mind wot dunceweaver does, do this instead

    it doesn't work because it's dunceweaver code (no offence, like).

    here's a better example:

    Code:
    ---IN <BODY> of document
    <div id=formdiv1 name=formdiv1 style="position:relative">
    	<form name="adminform">
    		<select name="select" onChange="myJumpMenu(window.parent,this)">
    			<option selected>Education Directory</option>
    			<option>--------------------------</option>
    			<option value="/about.html">About Education Department</option>
    			<option value="/calendar.html">Education Calendar 2004-05</option>
    			<option value="/academics.html">Academics</option>
    			<option value="/faculty.html">Education Faculty</option>
    		</select>
    	</form>
    </div>
    
    
    --In <HEAD> of document
    <script language="javascript" type="text/javascript">
    	
    	function myJumpMenu(oTrg,oSrc)
    	{
    		oTrg.location = oSrc.options[oSrc.selectedIndex].value;
    		oSrc.selectedIndex = 0;
    	}
    
    </script>
    hope that helps

  • #3
    New to the CF scene
    Join Date
    Jul 2004
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Dreamweaver Code

    Thanks for the reply. I used the Dreamweaver code as a last resort. I'd previously tried quite a few other methods, but with no success.

    Your code seems to work, even when hitting the back button and returning to the page, the menu still works. I am curious why 'this' works, but explicitly referencing
    'document.forms.adminform.options[document.forms.adminform.options.selectedIndex].value'
    does not work more than once in Netscape 4.x.

    I'd tried that method before posting to the forum. Anyway, I appreciate the quick response. Thanks again


  •  

    Posting Permissions

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