zoukankan      html  css  js  c++  java
  • form表单4种提交方式

    <!DOCTYPE html>
    <html>
    <head>
    <title>JavaScript表单提交四种方式</title>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
    <script type="text/javascript" >
    function submit()//第二种提交方式,用普通button按钮结合JavaScript提交
    {
    alert(11);

    //设置提交路径
    var submit= document.getElementById("submit");
    submit.submit(); //提交
    }
    </script>
    </head>
    <body>
    <!-- 第一种提交方式也是最普遍的提交方式 -->
    <form action="1111.html">
    用户名:<input type="text" value="1234" name="username">
    <input type="submit" value="submit提交"/>
    </form>
    <hr>
    <!-- 第二种提交方式,用普通button按钮结合JavaScript提交-->
    <form id="form1" action="2222.html">
    用户名:<input type="text" value="1234" name="username">
    <input id="submit" type="button" value="普通button结合JavaScript提交" onclick="submit();"/>
    </form>
    <hr>
    <!-- 第三种提交方式,用图片提交-->
    <form action="3333.html">
    用户名:<input type="text" value="1234" name="username">
    <input type="image" src="fmy.jpg" width="50px" height="50px"/>
    </form>
    <hr>
    <!-- 第四种提交方式,超链接提交,直接把表单内容写在链接中,几乎没人用-->
    <a href="44444.html?username=1234">超链接提交,直接把表单内容写在链接中,几乎没人用</a>
    </body>
    </html>

  • 相关阅读:
    根据 谷歌官网写一个 该浏览器上的扩展
    深度学习
    华为在线学习
    pandas 常规操作大全
    猎奇有些意思的
    LINUX 必知必会检测表--通读无关语言
    自动化部署三剑客 gitlab + ansible + jenkins
    python 框架
    delphi 多线程之System.TMonitor
    函数和对象 及 prototype和__proto__
  • 原文地址:https://www.cnblogs.com/wulinzi/p/6115921.html
Copyright © 2011-2022 走看看