English 中文(简体)
j QueryTools Validator - 将所有错误信息结合起来,并显示一个警示。
原标题:jQueryTools Validator - combine all error messages and display one alert()

I m 采用jQuery 工具Validator(jquerytools.org),通过缺席,每个领域都有错误信息。

相反,我喜欢将错误信息合并为一种定期的警示(正常的联合通报职能)。

我不认为这是文件中的一种选择。 是否有一个 ha子来做到这一点?

感谢您提供的任何帮助。

鉴此,正在对审定进行编码如下:

$.tools.validator.fn("[minlength]", function(input, value) {
    var minlength = input.attr("minlength");
    if(value.length != 0 && value.length < minlength) return  Minimum   + minlength +   characters ;
    else return true;
});

$.tools.validator.fn("[data-validate=name]", function(input, value) {
    if(!name_regex.test(value) && value) return  Contains invalid characters ;
    else return true;
});
最佳回答

It s not a hack -- you can use the onFail event handlers to do this. http://www.jquerytools.org/demos/validator/events.html

在表格未能证实的情况下,它执行该笔手递,但在显示任何错误信息之前。 通过归还虚假信息,你可以生成自己的错误信息,防止有效者出现错误。

问题回答

暂无回答




相关问题
getGridParam is not a function

The HTML: <a href="javascript:void(0)" id="m1">Get Selected id s</a> The Function: jQuery("#m1").click( function() { var s; s = jQuery("#list4").getGridParam( selarrrow )...

selected text in iframe

How to get a selected text inside a iframe. I my page i m having a iframe which is editable true. So how can i get the selected text in that iframe.

jQuery cycle page with links

I am using the cycle plugin with pager functionality like this : $j( #homebox ) .cycle({ fx: fade , speed: fast , timeout: 9000, pager: #home-thumbs , ...

jquery ui dialog opens only once

I have a button that opens a dialog when clicked. The dialog displays a div that was hidden After I close the dialog by clicking the X icon, the dialog can t be opened again.

jConfirm with this existing code

I need help to use jConfirm with this existing code (php & Jquery & jAlert). function logout() { if (confirm("Do you really want to logout?")) window.location.href = "logout.php"; } ...

Wrap text after particular symbol with jQuery

What I m trying to do, is wrap text into div inside ll tag. It wouldn t be a problem, but I need to wrap text that appears particularly after "-" (minus) including "minus" itself. This is my html: &...

热门标签