什么用仅用户名文本字段替换输入类型=电子邮件?

时间:2014-02-11 22:56:40

标签: jquery jquery-ui twitter-bootstrap

我不知道这个验证来自哪里。我相信它来自BootStrap。这对我来说都很好。

但我的输入类型不是email,只是username。我只想显示与password验证相同的验证弹出窗口。比如Please fill out this field

所以What input type I have to use for username textbox to get show same validation popup

 <input type="email" class="form-control" placeholder="User name" required="" autofocus="">
 <input type="password" class="form-control" placeholder="Password" required="">
 <label class="checkbox">
   <input type="checkbox" value="remember-me"> Remember me
 </label>
 <button class="btn btn-lg btn-primary btn-block" type="submit">Login</button>

enter image description here

enter image description here

1 个答案:

答案 0 :(得分:1)

我认为这就是你所说的话:

<input type="email" class="form-control" placeholder="User name" required="" autofocus="">

由于您已经拥有required="",因此您只需将type="email"更改为type="text"

<input type="text" class="form-control" placeholder="User name" required="" autofocus="">