1. 程式人生 > >HTML5表單控制元件與表單屬性

HTML5表單控制元件與表單屬性

<form action="<?php echo U('Home/Admin/register');?>" method="post" id="registerForm">
              <span>使用者名稱</span><input type="text" name="username" id="username" placeholder="*長度為4-20位非空字元" required autofocus/><br>
              <span>輸入密碼</span><input type="password" name="password" id="password" placeholder="*長度為6-18位非空字元" required pattern="\S{6,18}"/><br>
              <span>確認密碼</span><input type="password"  id="password2" placeholder="*兩次密碼請輸入一致" required/><br>
              <span>郵箱</span><input type="email" name="email" id="email" placeholder="*請輸入有效的郵箱地址" required/><br>
              <span>我的部落格</span><input type="text" name="boke" id="boke" placeholder="此項選填"/><br>
              <input type="submit" value="註冊" id="submit" />
          </form>