zoukankan      html  css  js  c++  java
  • HTML5表单增强

    感觉最大的改变就是表单元素可以不写在form标签中。写在其他地方,加个form属性就能提交了
    别的嘛感觉没什么,表单验证也不能提示信息,感觉不实用

    <!DOCTYPE html>
    <html>
        <head>
            <meta charset="utf-8" />
            <title></title>
        </head>
        <body>
            <h1>表单增强</h1>
            <form id="form1" action="index.html" method="post">
                
                <!--规定输入字段的值的模式或格式。传入一个正则-->
                <input type="text" pattern="[0-9]{11}" title="输入数字" placeholder="数字" />
                <!--required非空验证-->
                <input required="required" type="text" />
                <!--min最小值 max最大值-->
                <input type="number" min="10" max="100"  placeholder="数字10-100"/>
                    
                <!--formation规定提交地址,覆盖form表单的action-->
                <input type="submit" value="提交" formaction="action1.html" />
                <!--规定提交方法,覆盖form表单的method属性-->
                <input type="submit" value="提交" formmethod="get" />
                <!--和target属性一个意思-->
                <input type="submit" value="提交" formtarget="_blank" />
                
            </form>
            
            <!--form属性,值是form表单的id,表示从属于这个表单,不用写在form标签内-->
            <input form="form1" type="text" value="" />
            
        </body>
    </html>
  • 相关阅读:
    医疗器械那些事
    内审员学习1
    BA
    GMP文件分类与编码管理规程
    杂-电工学
    产品学习1
    模拟电子技术1
    电路组装1
    Unable to simultaneously satisfy constraints.
    xcode
  • 原文地址:https://www.cnblogs.com/yanshanshuo/p/4773289.html
Copyright © 2011-2022 走看看