redundant calling of form callbacks
Shouldn't the form callbacks be called once per validation? The each loop below seems to validate the form once per field instead of once per form.
validateForm = function(form, validators) {
var valid;
valid = true;
form.trigger('form:validate:before').find('[data-validate="true"]:input:enabled').each(function() {
if (!$(this).isValid(validators)) valid = false;
if (valid) {
form.trigger('form:validate:pass');
} else {
form.trigger('form:validate:fail');
}
return form.trigger('form:validate:after');
});
return valid;
};
Yes, this is fixed:
https://github.com/bcardarella/client_side_validations/blob/master/coffeescript/rails.validations.coffee#L68-72
I'm running:
gem 'client_side_validations', '~> 3.2.0.beta.1' gem 'client_side_validations-mongoid', '~> 2.4.0.beta.2'
Also I noticed https://github.com/bcardarella/client_side_validations/wiki/Callbacks asserts one can write:
clientSideValidations.callbacks...
but one must capitalize C as in:
ClientSideValidations.callbacks...
Also, did you ever implement support for :remote=>true?
Thx, Brian. -Ken
On Thu, Jan 26, 2012 at 12:06 AM, Brian Cardarella [email protected] wrote:
Yes, this is fixed:
https://github.com/bcardarella/client_side_validations/blob/master/coffeescript/rails.validations.coffee#L68-72
Reply to this email directly or view it on GitHub: https://github.com/bcardarella/client_side_validations/issues/260#issuecomment-3665626
The changes have not been packaged in a gem yet. I want to close out a few more issues before I package.
No haven't implemented :remote => true yet
Pretty-please implement :remote=>true -- I want to implement modal dialogs/forms. -Ken
On Thu, Jan 26, 2012 at 12:22 AM, Brian Cardarella [email protected] wrote:
The changes have not been packaged in a gem yet. I want to close out a few more issues before I package.
No haven't implemented
:remote => trueyet
Reply to this email directly or view it on GitHub: https://github.com/bcardarella/client_side_validations/issues/260#issuecomment-3665759
It's under way :)
If the gem can provide a function which injects an errors hash, programmers can call it in an ajax:success handler.
On Thu, Jan 26, 2012 at 12:36 AM, Brian Cardarella [email protected] wrote:
It's under way :)
Reply to this email directly or view it on GitHub: https://github.com/bcardarella/client_side_validations/issues/260#issuecomment-3665872