<form id="writeForm" method="post"> <div class="write-btn-tj"> <input type="button" value="提交日志"> </div> <div class="write-btn-drafts"> <input type="button" value="存储草稿"> </div> </form>
// 提交日志 $(".write-btn-tj input").click(function() { var writeForm=$('#writeForm'); writeForm.attr('action','/workreport/joblogController/jobLogWrite.html'); writeForm.submit(); }); $(".write-btn-drafts input").click(function() { var writeForm=$('#writeForm'); writeForm.attr('action','/workreport/joblogController/jobLogWrite.html?drafts=1'); writeForm.submit(); });