Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在我看来,我正在使用 jquery 将几个表单元素的可见性设置为无(实际上是通过调用fadeIn 和fadeOut 方法)。问题是由于隐藏了这些元素,不再对隐藏的元素执行验证。知道如何在隐藏(或折叠)元素时坚持验证检查吗?
您无法对不可见元素执行验证,因为它们甚至没有与表单一起提交。
也许您使用隐藏输入代替并在表单提交事件发生时执行一些填充