怎么在javascript里让struts表单提交

解决方案 »

  1.   

      with(document.getElementById("formName")) {
            method = "post";
            action = "<%=path%>/Action.do?action=";
    submit();
    }
    指定好路径就行了
      

  2.   

    <script>
     document.getElementByName('form_name').submit();
    </script
      

  3.   


    错的 document.getElementByName 没有这个方法
      

  4.   

    那是你form表单中没有这个属性吧,用document.getElementById也可以的。 
    或者直接document.forms["form"].submit();(form是提交表单的name) 
      

  5.   

     <html:button property="upload" onclick="dell()">删除</html:button>       js:function dell()  

           var flag = confirm("确定要删除吗?");
    if(flag ==0){
    return false;
    }else {
                document.forms(0).action="dellfiletype.do";  
    document.forms(0).submit(); 
    }
    }
      

  6.   

    写错了,是document.getElementByid('form_name').submit();
      

  7.   

    <html:form action="team.do?method=doAdd" method="post" focus="playerName" onsubmit="return check()">...