Forum Discussion
FICO
3 years agoCommunity Manager
How to access updated entity value in a JavaScript function?
I have written JS code to check on whether a user entered value is already in an index or not. However, I'm having a hard time passing in the modified entity value into the JS function. It seems the ...
FICO
3 years agoCommunity Manager
Here is a better solution after looking more at your VDL Language app. If I replace <vdl-field entity="newName"></vdl-field> with <input id="new_name" type="text" />, then add <vdl-action command="=document.getElementById('new_name').value"></vdl-action> and <vdl-action-update-entity entity="newName"></vdl-action-update-entity> before calling the JS function, the entity value will be updated even if I click the action button right after finishing typing in the text box. The only downside here is that the input text field is not automatically tied to the entity value so if I move to a different tab then come back, the content in the text field becomes empty again.