onChange issue

Discussion in 'JavaScript' started by deluxmilkman, Oct 26, 2007.

  1. #1
    I have 2 html menu.html and menu2.html,
    and would like to swich one another using "onChange" in each form.

    function pageCh works first time, but it doesn't 2nd time.
    alert("menu2") does not pop up either.




    javascript in menu.html
    
    
    <script language="JavaScript" type="text/JavaScript">
    <!--
    function pageCh(sectionURL) {
    
    parent.section.location.href = sectionURL;
    if(sectionURL == "section02.xml") {
    parent.menu.location.href = "menu2.html";
    }
    }
    
    //-->
    </script>
    
    
    HTML:
    form in menu.html


    
    
    <form>
    <select onChange="pageCh(this.value)">
    	<option value="section01.xml" selected>1/option>
    	<option value="section02.xml">2</option>
    </select>
    </form>
    
    
    HTML:



    javascript in menu2.html

    
    
    <script language="JavaScript" type="text/JavaScript">
    <!--
    
    alert("menu2");
    
    function pageCh(sectionURL) {
    alert(sectionURL);
    parent.section.location.href = sectionURL;
    if(sectionURL == "section01.xml") {
    parent.menu.location.href = "menu.html";
    
    
    }
    
    //-->
    </script>
    
    
    HTML:
    form in menu2.html

    
    
    <form>
    <select onChange="pageCh(this.value)">
    	<option value="section02.xml" selected>2</option>
    	<option value="section01.xml">1</option>
    </select>
    </form>
    
    
    HTML:

    thanks
     
    deluxmilkman, Oct 26, 2007 IP
  2. ezpz

    ezpz Peon

    Messages:
    25
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Could you post the relevant parts of the parent page?
     
    ezpz, Oct 26, 2007 IP