javascript - How do I make data-parsley-errors-container="#element" go away after all errors are resolved? -
How do I set an error container style after all the error messages have been resolved? I am using the data-parsley-errors-container = "# element"
to create a div
field at the top of my form. I will give it a background color I want to apply, but when I do, messages of all errors
after deleting me all & lt; Ul & gt;
I have a blank div
area of a colorful background I am impressed with Something similar was the problem, my job is below:
$ (document) .ready (function () {$ ('# formId'). Parsley (). Subscribe ('parsley: Field: Error ', function () {$ (' # ErrorDive '). CSS ({"Display": "Block"})}} $ (' # formId '). Parsley (). Subscribe (' Parsley: Field: success', function () {var totalErrorCount = $ ("# filterErrorDiv li"). Length; if (totalErrorCount == 0) {$ ('# errorDiv'). CSS ({"display": "none"} );}}};});
If there is an error in any area, the error event listener displays errorDiv For the success of field verification, the second listener checks for the existing problem solving error and hides the error if there is no error left.
Hope this will help you. Please accept the answer.
Comments
Post a Comment