<a href="javascript:f_submit('legal.jsp','3')"></a>function f_submit(url,arg){
  alert("aaaaa");
  document.myForm.consultationType.value=arg;
  document.myForm.action=url;
  document.myForm.submit();
  return false;
}运行出错'document.myForm1.consultationType' 为空或不是对象,可我的form名子是myForm呀,而且也没有其它表单了,这是怎么回事呀!!!

解决方案 »

  1.   

    如果form名是对的那可能是consultationType的问题
      

  2.   

    Form 里面,name="consultationType" 的有吗?
      

  3.   

    <input type="hidden" name="consultationType"/>,在form里的隐藏域里面有
      

  4.   

    你可以加几个alert看问题究竟出在哪function   f_submit(url,arg){ 
        alert("aaaaa"); 
        alert(document.myForm); 
        alert(document.myForm.consultationType); 
        alert(document.myForm.consultationType.value); 
        document.myForm.consultationType.value=arg; 
        document.myForm.action=url; 
        document.myForm.submit(); 
        return   false; 

      

  5.   

    错误提示:
    运行出错'document.myForm1.consultationType'   为空或不是对象,可我的form名子是myForm呀,而且也没有其它表单了,这是怎么回事呀!!!怎么是myForm1 ?? 难道你的源码里面的document.myForm.consultationType.value=arg;  是document.myForm1.consultationType.value=arg啊; 
    晕,没有看出来什么问题 =_=!
      

  6.   

    你的form名是myForm还是myForm1啊!
    在看看  呵呵!