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.
我正在尝试在我的 Yii 项目中重置表单
$form.reset();
这样我只能设法重置字段值,但仍然显示现有的验证错误。我怎样才能清除验证错误?
Yii 为这个功能安装了钩子,但它不方便地暴露它们。要完全重置表单,您需要执行以下操作:
$form.reset().trigger('reset');