Greetings,
In the Classic form designer, I was able to use JavaScript to update a span (inline container element) in a Custom HTML field to dynamically display content from a single line field.
For example in the Classic designer...
Define CSS class for a single line field that will contain the text I want to show up in the Custom HTML span element:
Custom HTML with span tag that will contain the content of the single line field:
Associated JavaScript:
$(document).on("change", ".CityEmailField", function() { $("#CityEmailField").text($(".CityEmailField input").val()).change(); });
This doesn’t work in the Modern form designer. Reading the Administration Guide, there’s a note that says “In the form designer, the Custom HTML field prevents access to the window and document objects in HTML events. For example, you will be unable to use document.getElementById or window.postMessage types of JavaScript calls.”. It does reference a post on how to safely use HTML events in the Modern form designer, but the use case in that post is not close enough to what I’m after for me to be able to cobble together JavaScript that works (despite some time spent trying... I'm by no means a JavaScript jockey).
Might anyone have the JavaScript equivalent to this that works in the Modern designer?
Thank you for your time and help.
Best regards,
Jeff