bcardarella/client_side_validations — Issue #285: implementing dynamic form validation for injected forms (eg. for backbone)
Author: fluxsaas
Created: 2012-02-26 14:33:53+00:00
State: open

Hey,
you pointed out that client_side_validation works only for forms build with a form builder. i had to add functionality to some forms from JST templates (to work with backbone) and found out that i just had to add the injected form to the *window.ClientSideValidations.forms* object. maybe it would help to add that to the documentation, here is what i added to validate an dynamicly injected fom:

and then call *$('form[data-validate]').validate();* "again".

the next step could be to generate *ClientSideValidations.form* templates to use for multiple forms. (e.g. a user_form object with specific validators. the *.validate();* could have a userId variable to target the specific user... well if i have some time i gonna try.