Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.

Using Template DOM/Dynamic JavaScript


Former Community Member
Hey everyone:

I'm attempting to write a script in the "click" event of a button that changes the script in the "enter" event of a text field for the rest of the time the form is open (or permanently will work too). I've been playing with the Template DOM with things like:

xfa.layout.mySubform.myTextField.event__enter.script.value += //the line being added.

I figure there will also have to be some kind of remerge afterwards. Anyone know if I'm on the right track? Anyone done something like this before? Anyone proven that it's impossible?

Any feedback or help would be greatly appreciated!

Ryan D. Lunka

Cardinal Solutions Group

1 Reply


Former Community Member
You cannot do that .....Your code is working but the changes to the template DOM are being discarded the next time the form lays itself out. It will go back to the original template thus ignoring your changes. Once the form is rendered you canno get at it. Can you modify the template before rendering (while it is in XDP mode)?