1. 第一种:使用type=submit  可以直接提交
  1. <html>
  2. <head>
  3. <title>submit直接提交</title>
  4. </head>
  5. <body>
  6. <!-- 表单的提交方式一 -->
  7. <form method="get">
  8. username: <input type="text" name="username"/>
  9. <br/>
  10. password: <input type="password" name="password"/>
  11. <br/>
  12. <input type="submit" value="提交"/>
  13. </form>
  14. </body>
  15. <script type="text/javascript">
  16. </script>
  17. </html>
  1. 第二种:使用type=button提交   需要得到表单的控件 使用表单空间调用自己的submit()方法
  1. <pre name="code" class="html"><html>
  2. <head>
  3. <title>button提交</title>
  4. </head>
  5. <body>
  6. <!-- 表单的提交方式二 -->
  7. <form id="form01" method="get">
  8. username: <input type="text" name="username"/>
  9. <br/>
  10. password: <input type="password" name="password"/>
  11. <br/>
  12. <input type="button" value="提交" onclick="form01();"/>
  13. </form>
  14. </body>
  15. <script type="text/javascript">
  16. //使用button进行表单的提交
  17. function form01() {
  18. //得到form标签
  19. var form01 = document.getElementById("form01");
  20. //提交form表单
  21. form01.submit();
  22. }
  23. </script>
  24. </html>

第三种:直接使用get网址 进行超链接提交


  1. <pre name="code" class="html"><a href="html?username=ccc&password=123456">超链接提交数据</a>

form表单提交三种方式,demo实例详解的更多相关文章

  1. JavaScript表单提交四种方式

    总结JavaScript表单提交四种方式 <!DOCTYPE html> <html> <head> <title>JavaScript表单提交四种方式 ...

  2. form表单提交信息的方式

    form表单提交信息的方法有两种,一种是get,一种是post.get提交的数据是在地址栏上提交,一般隐私数据不会选择这样方式.地址栏上只能提交字符. 如果使用的是post提交,那么信息都在消息正文中 ...

  3. 24.form表单提交的六种方式

    form表单提交方式 1.无刷新页面提交表单 表单可实现无刷新页面提交,无需页面跳转,如下,通过一个隐藏的iframe实现,form表单的target设置为iframe的name名称,form提交目标 ...

  4. form表单提交转为ajax方式提交

    <form action="xxx" method="get"> //action的值是请求的url地址 <div class="f ...

  5. python 获取表单的三种方式

    条件:urls.py文件中配置好url的访问路径.models.py文件中有Business表. 在views.py文件中实现的三种方式: from app01 improt models def b ...

  6. js表单提交一种方式

    在一个html和php混编的文件中,用到js提交表单的方法: 定义表单id为form1,提交按钮type为submit, var data_info = document.getElementById ...

  7. Form表单提交的简要方式

    <html> <head> <meta name="viewport" content="width=device-width" ...

  8. 清空FORM表单的几种方式 Reset 重加载

    1. form中定义name <form name = "sbform" action="sb_add.php" method="post&qu ...

  9. Form表单提交数据的几种方式

    一.submit提交 在form标签中添加Action(提交的地址)和method(post),且有一个submit按钮(<input type='submit'>)就可以进行数据的提交, ...

随机推荐

  1. svn_精简版【极速安装】

    1.进入官网下载:http://tortoisesvn.net/ 2.进行安装. 3.官方下载汉化包 [32 位,64位] 4.安装完汉化包后,右键->Settings 5.选择语言包,确定就o ...

  2. 【习题 4-9 UVA - 815】Flooded!

    [链接] 我是链接,点我呀:) [题意] 在这里输入题意 [题解] 题目很迷啊. 不会出现盆地? 可以理解为一条线. 从左往右高度上升的一座座山. 然后V升的水从最左边的山倒进去. 然后问你最后海拔多 ...

  3. Adaptively handling remote atomic execution based upon contention prediction

    In one embodiment, a method includes receiving an instruction for decoding in a processor core and d ...

  4. 洛谷 P1948 [USACO08JAN]电话线Telephone Lines

    P1948 [USACO08JAN]电话线Telephone Lines 题目描述 Farmer John wants to set up a telephone line at his farm. ...

  5. Spring MVC + Shiro + Redis 实现集群会话管理

    之前用的单机Shiro实现用户单点登陆,基本问题不大,但是集群间的session共享单靠Shiro就不好实现了.所以就借助Redis数据库来实现. 这里Redis的搭建我之前说过,感兴趣的可以去看看: ...

  6. Anton and Letters

    Anton and Letters time limit per test 2 seconds memory limit per test 256 megabytes input standard i ...

  7. 判断是否是pc,获取屏幕宽度

    $(function(){ var w=document.documentElement?document.documentElement.clientWidth:document.body.clie ...

  8. ZOJ 3829 Known Notation(字符串处理 数学 牡丹江现场赛)

    题目链接:problemId=5383">http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=5383 Do you ...

  9. 微软继MVC5后,出现ASP.NET VNEXT

    vNext又称MVC 6.0,不再须要依赖System.Web.占用的内存大大降低(从前不管是多么简单的一个请求.System.Web本身就要占用31KB内存). 能够self-host模式执行.站点 ...

  10. luogu1965 转圈游戏

    题目大意 n 个小伙伴(编号从 0 到 n-1)围坐一圈玩游戏.按照顺时针方向给 n 个位置编号,从0 到 n-1.最初,第 0 号小伙伴在第 0 号位置,第 1 号小伙伴在第 1 号位置,--,依此 ...