问题:在一个JSP页面中需要多个提交按钮,每个按钮点击后需要把同一个form提交到不同的页面进行处理

解决:用JS。

<html>
<head>
<title>一个表单、多个提交按钮、提交到多个不同页面</title>
</head>

<script>
function sm1(){
   document.getElementByIdx("form1").action="1.jsp";
   document.getElementByIdx("form1").submit();
}
function sm2(){
   document.getElementByIdx("form1").action="2.jsp";
   document.getElementByIdx("form1").submit();
}
</script>

<body>
<form action="" method="post" id="form1">
 <input name="mytext" type="text" id="mytext" />
 <input name="bt1" type="button" id="bt1" value="提交到1.jsp" onclick="sm1()" />
 <input name="bt2" type="button" id="bt2" value="提交到2.jsp" onclick="sm2()" />
</form>
</body>
</html>

document.form.command.value的更多相关文章

  1. js提交表单错误:document.form.submit() is not a function

    今天在写JS时,遇上这么个错误:"document.form.submit() is not a function",经过一番搜索,最终找到了修复方法. 这个错误一般是由于表单&l ...

  2. 不通过getElementByName实现获取表单数据 (document.form表单的name值.input输入框的name值)

    function update() { //document.form表单的name值.input输入框的name值 var username = document.form1.username; v ...

  3. 【转】document.form.action,表单分向提交

    document.form.action,表单分向提交,javascript提交表单 同一个表单可以根据用户的选择,提交给不同的后台处理程序.即,表单的分向提交.如,在编写论坛程序时,如果我们希望实现 ...

  4. javascript中document.form[formName][]的意思

    近来重新学习javascript发现还有很多知识点模糊,今天就javascript中的document.forms[formName][inputName]进行说明: <!DOCTYPE htm ...

  5. html中隐藏域hidden的作用介绍及使用示例

    基本语法: <input type="hidden" name="field_name" value="value"> 作用:  ...

  6. html中隐藏域hidden的作用

    基本语法: <input type="hidden" name="field_name" value="value"> 作用: ...

  7. input的type属性

    input的type属性:http://www.w3school.com.cn/tags/att_input_type.asp 基本语法: <input type="hidden&qu ...

  8. input hidden的作用

    网上辣么多blabla的,我就总结一下 1 什么是hidden hidden 是input type的一个值,叫隐藏域,官方解释:“Hidden 对象代表一个 HTML 表单中的某个隐藏输入域. 这种 ...

  9. html 中表单元素input type="hidden"的作用

    转自:https://blog.csdn.net/xiaobing_122613/article/details/54946559 (隐藏只是在网页页面上面不显示输入框,但是虽然隐藏了,还是具有for ...

随机推荐

  1. PAT (Advanced Level) 1090. Highest Price in Supply Chain (25)

    简单dfs. #include<cstdio> #include<cstring> #include<cmath> #include<algorithm> ...

  2. CodeForces 591A Wizards' Duel

    水题 #include<cstdio> #include<cstring> #include<cmath> #include<algorithm> us ...

  3. Ubuntu 12.04 中文输入法

    Ubuntu 12.04 中文输入法 [日期:2012-07-28] 来源:Linux社区  作者:lqhbupt [字体:大 中 小]   Ubuntu上的输入法主要有小小输入平台(支持拼音/二笔/ ...

  4. Ceph RBD CephFS 存储

    Ceph RBD  CephFS 存储 环境准备: (这里只做基础测试, ceph-manager , ceph-mon, ceph-osd 一共三台) 10.6.0.140 = ceph-manag ...

  5. sql语句之字符串匹配like

    sql没有正则表达式,只能使用like 语法 match_expression [ NOT ] LIKE pattern [ ESCAPE escape_character ] 参数 match_ex ...

  6. springMVC获取数据--注意post方法会出现中文乱码问题

    1. 新建web project 2. 加入jar 3. 改写web.xml <?xml version="1.0" encoding="UTF-8"?& ...

  7. Android代码资源的国际化

    internationalization (国际化)简称 i18n,因为在i和n之间还有18个字符,localization(本地化 ),简称L10n. 一般用语言_地区的形式表示一种语言,如  zh ...

  8. 修改SqlServer字段长度

    Alter Table  [JHEMR].[dbo].[PT_ERROR_LOG]  ALTER COLUMN  MESS  nvarchar(1000)

  9. Myeclipse创建新项目

    1. 打开myeclipse, 配置mysql server preference里找到 show view-- DB Browser, 新建数据库驱动. 1. URL填写: jdbc:mysql:/ ...

  10. Linux 分区和目录解析

    转自:http://www.cnblogs.com/apprentice89/archive/2012/12/17/2821332.html 计算机中存放信息的主要的存储设备就是硬 盘,但是硬盘不能直 ...