首页 > 解决方案 > Html输入属性不起作用

问题描述

我有一个表单,其中 input type="email" & input type="password" 在提交表单时都具有必需的属性,电子邮件未经验证(它接受简单的文本,例如'abcde'),并且两个字段也接受尽管写入了必需的属性,但为空值

 <form> 

    <div>
    <input type="radio" name="role" value="tbl_staff_details" checked />Institute/Branch
      <input type="radio" name="role" value="tbl_student_details" />Student/Parent

   <div id="msg" style="color: red;margin-top: 1%"></div>

</div>
  <div class="form-group has-feedback" style="margin-top: 5%">
    <input type="email" class="form-control" placeholder="Email" id="mail" required />
    <span class="glyphicon glyphicon-envelope form-control-feedback"></span>
  </div>
  <div class="form-group has-feedback">
    <input type="password" class="form-control" placeholder="Password" id="pwd" required />
    <span class="glyphicon glyphicon-lock form-control-feedback"></span>
  </div>
  <div class="row">
    <div class="col-xs-8">
      <div class="checkbox icheck">
        <label>
          <input type="checkbox"> Remember Me
        </label>
      </div>
    </div>
    <!-- /.col -->
    <div class="col-xs-4">
      <button type="button" class="btn btn-primary btn-block btn-flat" id="signin">Sign In</button>
    </div>
    <!-- /.col -->
  </div>

标签: html

解决方案


您描述的检查将在提交表单时进行。

您没有提交按钮。

移除type="button"(以便按钮元素使用默认值type="submit")。


推荐阅读