• 表单模板【加入简单验证】


    1. 模板
    
    <!DOCTYPE html>
    <html lang="en">
    
    <head>
      <meta charset="UTF-8">
      <title>Document</title>
      <link rel="stylesheet" href="/public/lib/bootstrap/dist/css/bootstrap.css">
    </head>
    
    <body>
      <div class="header container">
        <div class="page-header">
          <h1><a href="/">首页</a> <small>发表评论</small></h1>
        </div>
      </div>
      <div class="comments container">
        <!-- 
          表单中需要提交的表单控件元素必须具有 name 属性
          表单提交分为:
            1. 默认的提交行为
            2. 表单异步提交
    
            action 就是表单提交的地址,说白了就是请求的 url 地址
            method 请求方法
                get
                post
         -->
        <form action="/pinglun" method="get">
          <div class="form-group">
            <label for="input_name">你的大名</label>
            <input type="text" class="form-control" required minlength="2" maxlength="10" id="input_name" name="name" placeholder="请写入你的姓名">
          </div>
          <div class="form-group">
            <label for="textarea_message">留言内容</label>
            <textarea class="form-control" name="message" id="textarea_message" cols="30" rows="10" required minlength="5" maxlength="20"></textarea>
          </div>
          <button type="submit" class="btn btn-default">发表</button>
        </form>
      </div>
    </body>
    
    </html>
    
    
    
  • 相关阅读:
    poj 2186 && hdu 3836
    poj 2833 The Average
    hud 3062 Party
    论 ACM 与泡妞 (转载)
    poj 1064 Cable master
    poj Candies
    [转]人才流失的背后
    获取存储过程的ReturnValue值
    javascript js jquery获取元素位置代码总结
    【引用】xmlpath 操作 xml
  • 原文地址:https://www.cnblogs.com/amize/p/14882619.html
Copyright © 2020-2023  润新知