An invalid form control with name='xxx' is not focusable 的解决方案

在html5 Form表单中,有的时候须要特殊需求,须要隐藏一部分表单元素。提交的时候,浏览器console会报以下错误:css

An invalid form control with name='xxx' is not focusablehtml

缘由是部分隐藏的表单是require的,提交的时候须要验证。解决方法是,设置隐藏的元素,设置一个css样式:html5

.hidden{
   opacity: 0;
}

假如须要隐藏的表单元素,直接设置其class=“hidden”便可。就不要使用hide()和show()方法来显示隐藏了。浏览器

相关文章
相关标签/搜索