onChange event for multiple Fields
-
- Posts: 29
- Joined: Fri May 25, 2018
Hello,
it is possible to add a onchange for multiple Controls with 1 line code?
fd.field(Field1, Field2, Field3, Field4).change(function() {
alert("Has changed");
});
Thanks in advanced
it is possible to add a onchange for multiple Controls with 1 line code?
fd.field(Field1, Field2, Field3, Field4).change(function() {
alert("Has changed");
});
Thanks in advanced
Hello slashmaster,
No, you need to write code for each field separately. As a workaround, you can create an array with the internal names of all fields on the form and run the code for each field.
No, you need to write code for each field separately. As a workaround, you can create an array with the internal names of all fields on the form and run the code for each field.
Code: Select all
var fields= ['Field1', 'Field2', 'Field3'];
fields.forEach(function(name){
fd.field(name).change(function() {
alert("Has changed");
});
})
-
- Information
-
Who is online
Users browsing this forum: No registered users and 15 guests