English 中文(简体)
jquery accreditation plugin AddClass to disabilities areas
原标题:jquery validation plugin addClass to invalid fields

是否有办法在使用jquerys 鉴定假胜数时将一种形式退回无效的所有投入增加一个类别?

If so, how?

最佳回答

正如Surreal梦想所言,有效的制片人将自动对失败的田地适用错误分类。 但是,你可以这样做。 several hooks(error-related and other) 你可以在鉴定守则中使用。 这里与你的问题有关:

  • "Use this class to create error labels, to look for existing error labels and to add it to invalid elements."

  • errorPlacement

    "Customize placement of created error labels. First argument: The created error label as a jQuery object. Second argument: The invalid element as a jQuery object."

例如:

$("whatever").validate({
    errorClass: "yourErrorClassHere",
    errorPlacement: function(error, element) {
        // You can do all sorts of stuff to the individual error elements, like adding classes
    }
});
问题回答

暂无回答




相关问题
Bind Button.IsEnabled to custom validation with XAML?

I am sorry I didn t know how to title my question any better, you name it if you got a good 1. I have an entity Contact. this person has navigation properties: Address, Phones (A collection of Phone)....

WPF - MVVM - NHibernate Validation

Im facing a bit of an issue when trying to validate a decimal property on domain object which is bound to a textbox on the view through the viewmodel. I am using NHibernate to decorate my property on ...

Wpf Combobox Limit to List

We are using Wpf Combobox to allow the user to do the following things: 1) select items by typing in the first few characters 2) auto complete the entry by filtering the list 3) suggesting the first ...

Rails 101 | validates_currency?

I ve searched high and low, but I could not find a solution, to what I think seems like a very common task. In a form I want to have a text input that accepts currency strings (i.e. $1,000,000 or ...

CodeIgniter form verification and class

I m using the form validation library and have something like this in the view <p> <label for="NAME">Name <span class="required">*</span></label> <?...

热门标签