Skip to content
This repository has been archived by the owner on Feb 10, 2019. It is now read-only.

errorClass different element #15

Closed
IschaGast opened this issue Mar 8, 2011 · 7 comments
Closed

errorClass different element #15

IschaGast opened this issue Mar 8, 2011 · 7 comments

Comments

@IschaGast
Copy link

Sometimes you want to add an errorClass to an element that's around your label and inputs. This way you can change the color from your labels etc...

That would be a nice feature.

@ericelliott
Copy link
Owner

Thanks for the suggestion. It's certainly a good one. In the mean time, you can override the markValid and markInvalid functions, but be aware, I'm planning to change the function signatures in the next version.

@jan-harmsen
Copy link

+1 regarding errorClass for different element.
I am currently evaluating various html5 form libs and just stumbled on h5Validate which looks quite good on first impression.
What does concern me is your remark about changing the API (function signatures) in the next version, since this breaks backwards compatibility. What is the general strategy towards providing backwards compatibility in future versions of h5Validate? Thanks!

@ericelliott
Copy link
Owner

I think what I'll do is offer callbacks that you can pass in for markValid and markInvalid so that you can do whatever you need to do to customize your implementation, and still take advantage of all the testing and best practices that we've baked into h5Validate.

FYI, the function signatures have already been updated - replaced the parameters with an options collection so that we can make non-breaking changes if we need to modify options in the future.

I don't anticipate any more breaking changes. The roadmap for 1.0 is to let users pass in their custom callbacks during initialization, so that won't require any incompatible changes to the API.

@jan-harmsen
Copy link

THANKS for responding that fast and with such good news, sounds great, that's exactly what I had hoped for :-)

@ericelliott
Copy link
Owner

In case you're curious -- those callbacks have been pushed as of 0.6.0 -- but I haven't written any documentation for them. You can pass in callbacks for both markValid and markInvalid methods, and there's some other new hotness as well: $('#myField').h5Validate('isValid') will return true or false, as will $('myForm').h5Validate('allValid); -- but there is a chance that I'll change the function signatures on those before the 1.0 release.

@tmikaeld
Copy link

tmikaeld commented Nov 1, 2011

Please let us know if you change those, as i'm currently using them extensively.

@ericelliott
Copy link
Owner

isValid changed today. You might want to look at the diff from the last pull.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants