0

我使用了引导表单验证,但它在safari 浏览器中不起作用。When I select first option and submit but it remain disabled, but when select the second option then it work well and removed the disabled. 请帮助我......我的代码在这里......


<select name="gender" class="form-control" required="true">
  <option value="">Select Gender</option>
  <option value="Male">Male</option>
  <option value="Female">Female</option>
</select>

4

1 回答 1

1

在 Safari 中保证客户端表单验证的唯一方法是使用 javascript。

Safari 不完全支持requiredhtml 属性。

也就是说,无论如何,为客户端验证设置一个单独的层并不是一个坏主意,它没有被纳入引导程序。如果您绑定到表单提交事件,则很容易遍历字段并进行自己的评估。

于 2016-04-24T16:27:23.937 回答