Foundation中手动触发Abide验证

Foundation中手动触发Abide验证

本文介绍了在Zurb Foundation中手动触发Abide验证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使自己成为表单,但是我需要根据是否正确输入表单来防止一些UX东西.是否有用于手动发出验证例程到表单字段的api?我知道我可以听验证后的事件,但实际上我需要从外部来源开始验证.

I'm trying to make myself a form, but I need to prevent some UX stuff depending on if a form was entered correctly. Is there an api for manually issuing the validation routine to a form's field? I know that I could listen to the post-validation events, but I actually need to start the validation from an external source.

这可能吗?

推荐答案

您可以使用jQuery将更改事件分派到表单:$("#myForm").trigger("change");
它将触发验证.

You can dispatch a change event to the form with jQuery: $("#myForm").trigger("change");
It will trigger validation.

这篇关于在Zurb Foundation中手动触发Abide验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-02 12:48