.change(call named function)
Hi Dmitry,
I'd like for several different fields to call the same function when any of them are changed.
This may relate to my inexperience in all this, but when when I put a previously (outside the change) named function inside the change() handler it seems to break after working once.
I don't have to repeat the same long function inside each change() do I?
I'd like for several different fields to call the same function when any of them are changed.
This may relate to my inexperience in all this, but when when I put a previously (outside the change) named function inside the change() handler it seems to break after working once.
I don't have to repeat the same long function inside each change() do I?
- Dmitry Kozlov
- Site Admin
- Posts: 1524
- Joined: Thu Jun 07, 2012
Hi,
Of course, not. You can define a single handler for multiple events this way:
Of course, not. You can define a single handler for multiple events this way:
Code: Select all
function OnFieldChanged() {
// your code here
}
fd.field('Field1').change(OnFieldChanged);
fd.field('Field2').change(OnFieldChanged);
-
- Information
-
Who is online
Users browsing this forum: No registered users and 8 guests