一个表单,两个提交按钮怎么实现?...
<>

解决方案 »

  1.   

    用两个button,然后各自传如URL,然后Form.action=URL;FormName.submit();
      

  2.   

    就是用button,然后使用js控制!
    function formSubmit(type){
    if(type=="submit"){
    formQuotationView.action ="<bean:write name="path"/>/QuotationSubmit.do";
    }
    if(type=="across"){
    formQuotationView.action ="<bean:write name="path"/>/QuotationAcross.do";
    }
    if(type=="untread"){
    formQuotationView.action ="<bean:write name="path"/>/QuotationUntread.do";
    }
    if(type=="discard"){
    formQuotationView.action ="<bean:write name="path"/>/QuotationDiscard.do";
    }
    if(type=="restore"){
    formQuotationView.action ="<bean:write name="path"/>/QuotationRestore.do";
    }
    if(type=="excel"){
    formQuotationView.action ="<bean:write name="path"/>/QuotationExcel.do";
    }
    if(type=="toOrder"){
    formQuotationView.action ="<bean:write name="path"/>/QuotationToOrder.do";
    }
    if(type=="back"){
    formQuotationView.action ="<bean:write name="path"/>/QuotationBack.do";
    }
    formQuotationView.submit();

    }
      

  3.   

    <html><head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <meta name="GENERATOR" content="Microsoft FrontPage 4.0">
    <meta name="ProgId" content="FrontPage.Editor.Document">
    <title>New Page 1</title>
    </head><body><form name="formtest" id="formtest" method="post" >
    <input name="userName" id="userName" type="text" value="测试;">
    <input name="buttonA" id="buttonA" value="按钮A" type="button" onClick="submitA()">
    <input name="buttonB" id="buttonB" value="按钮B" type="button" onClick="submitB()">
    </form></body></html>
    <script>
    function submitA(){
       formtest.action = "testA.jsp";
       formtest.submit();
    }
    function submitB(){
       formtest.action = "testB.jsp";
       formtest.submit();
    }
    </script>
      

  4.   

    把两个表单的action=""指向不同的处理页面