function surfto(form)
{
    var star1=PulldownMenu.aaaa.selectedIndex
    var end1=PulldownMenu.bbbb.selectedIndex
    var myindex=PulldownMenu.maintitle.selectedIndex
    
    var txt = PulldownMenu.maintitle.options[myindex].value
    var txt1 = "---" + PulldownMenu.aaaa.options[2].value
    var txt2 = "---" + PulldownMenu.bbbb.options[3].value
    
    window.alert( txt + txt1 + txt2 );
    window.open(txt, "ViewFrame", "toolbar=no,location=yes,directories=no,status=no,menubar=yes,scrollbars=yes, resizable=no,copyhistory=yes,width=680,height=310");
}
// -->
</script>

解决方案 »

  1.   

    你错的原因,要用form的名字,而不是直接写form!!!
      

  2.   

    input type="button" onClick=surfto(this.form) value=确定 style="font-size: 9pt" name="button">改为:
    input type="button" onClick=surfto() value=确定 style="font-size: 9pt" name="button">function surfto(form)
    改为:
    function surfto()
      

  3.   

    也可以这么改:……………………<input type="button" onClick=surfto(this.form) value=确定 style="font-size: 9pt" name="button">
    </form>
    </p></body></html><script language=JavaScript>
    <!-- Hide
    function surfto(www)
    {
        var star1=www.aaaa.selectedIndex
        var end1=www.bbbb.selectedIndex
        var myindex=www.maintitle.selectedIndex
        
        var txt = www.maintitle.options[myindex].value
        var txt1 = "---" + www.aaaa.options[2].value
        var txt2 = "---" + www.bbbb.options[3].value
        
        window.alert( txt + txt1 + txt2 );
        window.open(txt, "ViewFrame", "toolbar=no,location=yes,directories=no,status=no,menubar=yes,scrollbars=yes, resizable=no,copyhistory=yes,width=680,height=310");
    }
    // -->
    </script>
      

  4.   

    不要用javascript的保留字做为参数或变量名字!
      

  5.   

    我都试了!
    只改对应的部分!!
    改为:<input type="button" onClick=surfto(this.form) value=确定 style="font-size: 9pt" name="button">
    </form>
    </p></body></html><script language=JavaScript>
    <!-- Hide
    function surfto(www)
    {
        var star1=www.aaaa.selectedIndex
        var end1=www.bbbb.selectedIndex
        var myindex=www.maintitle.selectedIndex
        
        var txt = www.maintitle.options[myindex].value
        var txt1 = "---" + www.aaaa.options[2].value
        var txt2 = "---" + www.bbbb.options[3].value
        
        window.alert( txt + txt1 + txt2 );
        window.open(txt, "ViewFrame", "toolbar=no,location=yes,directories=no,status=no,menubar=yes,scrollbars=yes, resizable=no,copyhistory=yes,width=680,height=310");
    }
    // -->
    </script> 
      

  6.   

    由于您这两句
    var txt1 = "---" + www.aaaa.options[2].value
    var txt2 = "---" + www.bbbb.options[3].value都是固定的,所以txt1和txt2的值是固定的!
      

  7.   

    现在的问题是:
    www.bbbb.option[].value的括号中填入数字还是end1都可以,但是在
    www.aaaa.option[].value的括号中只能填数字,start1就不行了。
    请指点。
      

  8.   

    发现了,star1中少写了一个t。