You are viewing limited content. For full access, please sign in.

Discussion

Discussion

Multiple Field Change

posted on December 11, 2024

Hi, I would like to see if this is allowed. I would like to have three trigger points. So if any one of the fields is clicked then the change happens.

LFForm.onFieldChange(function() {
   CODE 
}, {fieldId: 89}, {fieldId: 71}, {fieldId: 72});

0 0
replied on December 11, 2024 Show version history

You could do what you want with a reusable function called by multiple event handlers.

LFForm.onFieldChange(() => myFunction(), {fieldId: 35});
LFForm.onFieldChange(() => myFunction(), {fieldId: 36});

function myFunction() {
  // do something
}

Something to note is that it seems to fire the onFieldChange event for every keystroke, so depending on what you need you might want to use the onFieldBlur event instead.

2 0
You are not allowed to follow up in this post.

Sign in to reply to this post.