如果不写onChange(),有没有其他办法

解决方案 »

  1.   

    this.form.department.options[0].value=this.options[this.selectedIndex].value;
    this.form.department.options[0].text=this.options[this.selectedIndex].text;
      

  2.   

    楼上的,你传给department.的值是什么啊?我要传的是:departmentID
      

  3.   

    容易:...
    <option value="<%=subjectID%>" depID=<%=departmentID%> depTxt=<%=department %>><%=subject%></option>
    ...然后,在第一个select的onchange事件里面调的函数里面这样写:document.all.department.options[0].value=document.all.title.options[document.all.title.selectedIndex].depID;
    document.all.department.options[0].text=document.all.title.options[document.all.title.selectedIndex].depTxt;搞定!
    或许你是有form的,那么就把document.all都换成你的form的名字,就可以了。