网络编程 发布日期:2025/11/18 浏览次数:1
用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">