让一个表单根据不同的情况提交给两种不同的方法处理
2015-08-14 09:42
525 查看
<form method="post" action="" id="subForm" name="form1">
<table>
<tr>
<td></td>
<td></td>
</tr>
</table>
</form>
导航条上面有批量删除(onclick="delall()")和批量下载(onclick="downall()")两个按钮
第一种情况:表单里面没有提交按钮(submit)
js里面写:
delall(){
document.form1.action="__APP__/Document/Collection/delFile"; //改变form里面action的值
$("#subForm").submit(); //提交表单
}
downall(){
document.form1.action="__APP__/Document/Collection/downFile";
$("#subForm").submit();
}
第二种情况:表单里面有提交按钮
delall(){
document.form1.action="__APP__/Document/Collection/delFile"; //改变form里面action的值
}
downall(){
document.form1.action="__APP__/Document/Collection/downFile";
}
<table>
<tr>
<td></td>
<td></td>
</tr>
</table>
</form>
导航条上面有批量删除(onclick="delall()")和批量下载(onclick="downall()")两个按钮
第一种情况:表单里面没有提交按钮(submit)
js里面写:
delall(){
document.form1.action="__APP__/Document/Collection/delFile"; //改变form里面action的值
$("#subForm").submit(); //提交表单
}
downall(){
document.form1.action="__APP__/Document/Collection/downFile";
$("#subForm").submit();
}
第二种情况:表单里面有提交按钮
delall(){
document.form1.action="__APP__/Document/Collection/delFile"; //改变form里面action的值
}
downall(){
document.form1.action="__APP__/Document/Collection/downFile";
}
相关文章推荐
- c 16进制数组转换成ASCII字符串
- iOS集成支付宝
- android oom
- ubuntu14.04 +nginx+php5-fpm
- oracle 游标实例
- HDU 5373 The shortest problem (简单模拟)
- Rank List
- Windows API ——CreateMutex——创建互斥对象
- 输入输出优化代码
- Hololens开发,Unity不是必选的,但当下是唯一的
- 排序算法之希尔排序
- 电子时钟
- Rank List
- oracle查看写法效率
- JSON 数据格式
- EAS BOS 实现发送消息
- Chapter 10 – Test
- 一个jsp的注册界面
- C#遍历Hashtable
- 003--映射文件详解