casperin/nod

mynod.performCheck returns 'undefined'

Opened this issue · 1 comments

Overall you've made a very nice validation library, as I really like the interface. Only confusion is with performCheck, where I'm building a multi-step form and I'm trying to validate all my fields before changing view. Unfortunately, mynod.performCheck('#step1 input[type="checkbox"]') returns 'undefined' instead of error or validation result.

What could be the case?

Thanks a lot! The interface really do make or break modules, I agree. We don't spend enough time thinking about them.

It sounds like either a bug, or that you're trying to get a result of a non-existing element.

If it's the former, I'll fix it (or you can take a shot at it. nod is just one file, with fairly extensive comments). Could you make a codepen.io that shows the problem? That makes it infinitely easier for me to take a crack at.

If it's the latter, I think nod should return an 'ELEMENT_NOT_FOUND' string, or some such. undefined is (evidently) entirely useless as it could mean anything.