Jump to content
  • 0

Event Listener to update Datapage with lookup Table changes


bcjks
 Share

Question

Hello, 

I have an email field in a details page within a Datapage with a cascading dropdown that should populate email data from a lookup table. 

Most recently, any changes to the lookup table email field has not been updating the field in the details page.  Upon research, I think I need to include an event listener but I am not sure what coding is required and where to insert it. 

Any help is appreciated.  Thank you

Capture.PNG

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

Hi @bcjks

If you want to update some other field when the Cascading field for email updates, you can use 'change' EventListener. Just add another HTML Block, and use something like this:

<script>
const emailCascField = document.querySelector('input[name="cbParamVirtual1"]'); //Your email field
emailCascField.addEventListener('change', (e)=>{
    const anotherField = document.querySelector('input[name="EditRecordOtherFieldName"]'); //Field you want to populate
    anotherField.value = emailCascField.value;
});
  
</script>

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...