一个表单不同的提交方式和路径
来源:互联网 发布:windows聚焦图片位置 编辑:程序博客网 时间:2024/06/15 02:31
1.表单
<form method="POST" enctype="multipart/form-data" action="/upload" id="upLoad"> <div class="form-group"> <p>gid: <input type="text" name="gid" id="gid"/></p> </div> <div class="form-group"> <input type="file" name="file" id="file"/> </div> <!--<p><input type="submit" value="上传" th:onclick="'javascript:upLoad()'"/></p>--> <input type="button" id="upLoadButton" th:onclick="'javascript:upLoad()'" th:value="上传"/> <input type="button" id="checkButton" th:onclick="'javascript:checkUploadButton()'" th:value="查看已上传图片"/></form>
2.js提交代码function upLoad() { var gid = document.getElementById("gid"); var file = document.getElementById("file"); if (gid.value == null || gid.value == "") { alert("你没有输入gid"); } else if (file.value == null || file.value == "") { alert("你没有选中文件"); } else { document.getElementById("upLoad").action = "/upload"; document.getElementById("upLoad").method = "post"; document.getElementById("upLoad").submit(); }}function checkUploadButton() { var gid = document.getElementById("gid"); if (gid.value == null || gid.value == "") { alert("你没有输入gid"); } else { document.getElementById("upLoad").action = "/checkUpload"; document.getElementById("upLoad").method = "post"; document.getElementById("upLoad").submit(); }}
0 0
- 一个表单不同的提交方式和路径
- form表单get和post提交方式的不同
- from表单提交的不同方式
- 表单的提交方式POST和GET
- 表单的提交方式:get和post
- 将一个表单提交到不同页面的方法
- 一个表单同时提交到两个不同的页面
- 一个form表单提交到两个不同的action中
- 一个表单两个submit提交到不同的页面
- ajax方式和修改form属性action(提交路径)方式提交form表单
- 表单提交的方式
- 表单提交的方式
- 表单提交的方式
- 表单的提交方式
- 表单的提交方式
- 多不同按钮提交一个表单,提交到不同的action中
- 提交表单到不同页面方式
- JSP表单提交和ajax提交表单数据是不同的,冲突的,不能同时进行
- 一、通过html页面打开Android本地的app
- licode API (译文)
- 多个div在一个div中一行水平显示(float)
- 如何使用CCRenderTexture创建动态纹理 Cocos2d-x 2.1.4
- FragmentPagerAdapter刷新fragment无效,亲测已解决
- 一个表单不同的提交方式和路径
- Linux的SOCKET编程详解
- Activity的管理
- JavaScript中的this,call,apply使用及区别详解
- 在Unity3D中使用Visual Studio调试shader
- bitmap软引用和虚引用
- plsql中文乱码,显示问号
- python机器学习库sklearn与graphlab与opencv的安装
- 不要小瞧html元素的关闭