editable onchange event
See issue #216 "But what I would really like to have is a way to change the label of another element in the form depending on the input value of this select. Do you have a suggestion on how to accomplish this?"
Code for this should not be edited in a custom validation editor of course (f.e. a problem with execution serverside). It would be an enhancement to have a separate editor in the field properties for this.
This should be fairly easy with a modification to the current implementation of custom validations (shouldn't matter on the backend, if thats why you expressed concern). We just need to update the component reference and add the form too....
Actually, as I'm writing this, it may be possible already using scope.form (untested), but if my thought is correct, in the custom validator, you can do something like:
var form = scope.form;
form.components.forEach(function(component) {
if (component.key == 'myFieldToChange') {
component.label = 'My new Label!';
}
});
valid = ...
We should expose the formio-utils so it's easier to traverse the component structure though..
Another reason why I don't want to edit this functionality in a custom validation is separation of concerns. Otherwise you open the route to hell.