detect event on many fields
detect event on many fields
Hello everybody.
In my editor, I have several fields whose name begin in an idetical way. I would like to detect an event change on all fields.
editor.field('sample_numbers.sample_Feces').input().on('change', function() {
show_samples($(this));
});
editor.field('sample_numbers.sample_Hair').input().on('change', function() {
show_samples($(this));
});
editor.field('sample_numbers.sample_T').input().on('change', function() {
show_samples($(this));
});
Is it possible to detect all fields whose name begin by 'sample_numbers.sample_ '
editor.field( begin by 'sample_numbers.sample_ ').input().on('change', function() {
show_samples($(this));
});
How can i do this ?
Thanks for your help.
Lionel
This question has an accepted answers - jump to answer
Answers
No sorry. There is no multi-field API in Editor at the moment. Best option is to have an array of the field names and then loop over that.
Allan
Thanks a lot. Allan.