Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bind vs validate: element vs elementId #26

Open
troyji opened this issue Sep 2, 2011 · 1 comment
Open

bind vs validate: element vs elementId #26

troyji opened this issue Sep 2, 2011 · 1 comment

Comments

@troyji
Copy link
Contributor

troyji commented Sep 2, 2011

regula.bind takes an option parameter of 'element', which is a DOM element to operate on. regula.validate takes an option parameter of 'elementId', a string id of an element to operate on. This is inconsistent.

Instead of changing to one or the other, I would propose that both functions should simply allow either parameter.

It could also be argued that both methods should accept an array of element id strings of elements ('elementIds') to operate on in addition to their already existing parameter that takes a list of DOM elements ('elements') to operate on.

@vivin
Copy link
Owner

vivin commented Sep 2, 2011

The reason I used elementId in validate() initially was to enforce the requirement that all elements that are validated, require id's. But since regula automatically adds id's to elements that don't have id's, I'd say this requirement isn't necessary anymore; your suggestions make sense and I'll put this on my list of things to do :).

@ghost ghost assigned vivin Sep 2, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants