开发者

jQuery Validation Single Message for each rule

开发者 https://www.devze.com 2023-03-12 07:51 出处:网络
I have an application with several input fields that have the required jQuery validation rule. If the fields are invalid I want to highlight them all however I only want a single messag开发者_如何学

I have an application with several input fields that have the required jQuery validation rule.

If the fields are invalid I want to highlight them all however I only want a single messag开发者_如何学Ce for required to be displayed at the top of the page.

I am displaying the messages on the top of the page with the errorLabelContainer attribute.

What is the best way to limit each rule to display only a single message?


When processing the validation of input filed's you could create a new String, each time there is a validation error append the string with the validation error from each input field. Then set the inner html of errorLabelContainer to the string value.

0

精彩评论

暂无评论...
验证码 换一张
取 消