Closed tmikaeld closed 12 years ago
I'm not sure what you mean. Could you give me a more detailed use-case?
I'm making a form with several steps, and i wan't to validate each step before the user can continue to the next. It's not really a problem now, since i found $('#myField').h5Validate('isValid') and $('myForm').h5Validate('allValid); in you'r comment. I'm implementing them right now. Though it would be better if i could validate-check a whole fieldset, is that possible?
You could make them separate forms. Make the user clear 'allValid' on one before you enable the next... You can run as many instances of h5Valiadate as you want on the same page. It's totally instance safe.
Or don't make them separate forms, just use a classname selector for the different parts?: $('.step1').h5Validate(), $('.step2').h5Validate(), etc..
So if i add the class to each field, then validate, it will validate-check them all? That's really neat :-)
But you mentioned that isValid changed, so the new method is to use $('.step1').h5Validate() in an if statement and it will return true false?
EDIT: Nevermind, i saw that isValid is still in use, just changed a little.
I also noticed that this uses jQuery 1.4.2, is it safe to use with jQuery 1.6.4?
That's great. I'll test it with 1.6.4 as much as i can, you might find an automated testsuite useful. If i get the time, i'll try and build a testsuite for it.
And thanks for a great plugin, it's the best html5 validator plugin i have found (and i think i have tried them all).
A testsuite is definitely coming. I want to use QUnit: http://docs.jquery.com/QUnit
I would LOVE help. =)
I appreciate the help and comments.
I have a tight deadline for the project i'm on right now, but once i'm done i can try and help out. I haven't made a unit tester before, but it will be very much worth the experience.
I started a test suite. It's not 100% coverage, but it covers the basics. Upgraded to jQuery 1.7. All tests pass in IE7 - IE9, Chrome, Safari, Android browser, and Opera. Will test iOS tomorrow. Check it out.
Wow, amazing work dilvie! I will be sure to check it out once i have time :-)
EDIT: I checked the source just now, simple but effective ;-)
Feel free to add some tests. I'd love to have better coverage. Especially better coverage of the built-in patterns. =)
I want to cover allValid, as well, but I think I'm about to make some changes to how that works. (Planning to trigger an event and pass out a list of invalid fields from it).
It would be great if this plugin could support multipart forms, for example validating a div with fields at a time.