如何触发绝对位置验证引擎功能来验证按钮单击时的字段?
我正在使用绝对位置的 jQuery 验证引擎。该函数在提交时触发,并在 dom 准备好时调用该函数。
位置绝对函数触发
jQuery(document).ready(function(){
// binds form submission and fields to the validation engine
jQuery("#formID").validationEngine();
});
以上函数是函数的基本初始化。当 dom 准备好时,该函数被触发,并且当提交具有 FormID 的表单时,它将验证该表单。
但我想通过单击按钮而不是提交按钮来验证字段。
<input type="button" value="validate" id="next" name="next">
我想要这样做的原因是因为我在向导中使用验证,提交按钮将位于表单的最后一步。但每个字段中都会有下一个按钮,用于转到表单向导的下一页。我想在单击第一页中的下一个按钮时验证第一页中的字段。
请告诉我该怎么做?
位置绝对验证引擎
http://www.position-absolute.com/articles/jquery-form-validator-because-form-validation-is-a-mess/
I am using a jQuery validation engine by position absolute. The function gets triggered on submit and the function is called when dom is ready.
Position Absolute Function trigger
jQuery(document).ready(function(){
// binds form submission and fields to the validation engine
jQuery("#formID").validationEngine();
});
The above function is a basic initialization of the function. When the dom is ready, the function is triggered and when the form with FormID is submitted it will validate the form.
But i want to make it validate the fields by clicking a button instead of a submit button.
<input type="button" value="validate" id="next" name="next">
The reason why i want to do is because am using validation in a wizard, the submit button will be in the last step of the form. but there will be next buttons in every field to go to the next page of the form wizard. I want to validate the fields in the first page when the next button in the first page is clicked.
Please tell me how can i do it ?
Position Absolute validation engine
http://www.position-absolute.com/articles/jquery-form-validator-because-form-validation-is-a-mess/
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
会这样做:
然后在按钮的单击事件中添加以下内容:
Would do it this way:
and then add the following in the click event for button:
试试这个:
Try this: