I've been using help templates that require other fields' values. These templates are evaluated using form.getValue() when the user hovers over an input ( as my help fields are styled as tooltips ). For an average form, it would probably perform well enough to evaluate on all 'change' events ( and the option should be turned off by default anyway ).
Is this a feature that could be a useful option in the core library (ie, should I write it into Form / Field class and file a pull request), or is it better suited to a plugin?
It seems like the most basic implementation wouldn't be much more than inserting these 2 code blocks into
evaluateHelpTemplate: function( formValues ){
//helpClassName should be a setting with a default, same as errorClassName
this.$( this.helpClassName ).replaceWith( _.template( this.help, formValues ) );
}
I've been using help templates that require other fields' values. These templates are evaluated using
form.getValue()
when the user hovers over an input ( as my help fields are styled as tooltips ). For an average form, it would probably perform well enough to evaluate on all 'change' events ( and the option should be turned off by default anyway ).Is this a feature that could be a useful option in the core library (ie, should I write it into Form / Field class and file a pull request), or is it better suited to a plugin?
It seems like the most basic implementation wouldn't be much more than inserting these 2 code blocks into
Form https://github.com/powmedia/backbone-forms/blob/master/src/form.js#L79
Field