用js提交表单解决一个页面有多个提交按钮的问题
(编辑:jimmy 日期: 2025/12/27 浏览:3 次 )
用js提交表单解决一个页面有多个提交按钮的问题,主要是判断是否为提交文本,然后再执行相应的动作,比较简单。
<pre class="javascript" name="code">function check(txt){
$j("form").submit(function(){
if($txt=="提交"){
this.action="doAddMessage.action";
this.submit();
}else{
this.action="doAddMessage.action";
this.submit();
}
});
}</pre><br>
<input type="IMAGE" src="/UploadFiles/2021-04-02/send.png">下一篇:浅析JQuery中的html(),text(),val()区别