user6166
user6166

Reputation: 143

magento hide validation message

On my magento site, validation is done by prototype validation. Everytime validation fails, error message for that field appears. As soon as you start typing in that field the error message fades out. What I want to do is fade out the error message if user clicks anywhere in the form. link to the javascript file

https://github.com/atetlaw/Really-Easy-Field-Validation/blob/master/validation.js

Upvotes: 0

Views: 1893

Answers (1)

clockworkgeek
clockworkgeek

Reputation: 37700

In the following snippet remember to replace FORM_ID with the ID of your form.

Event.on('FORM_ID', 'click', function() {
    // fall back to plain hiding if cannot fade
    var hide = self.Effect && Effect.Fade || Element.hide;
    // this = form being watched
    this.select('.validation-advice').each(hide);
});

Upvotes: 1

Related Questions