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.

how do i add a button that when clicked adds an image field or text field to a document


Level 1

I'm trying to create a template for pastors to use.  They usually have several points and usually use pictures in their sermon notes.  I was wanting to create a form that they could use to put their notes in.  I was thinking of using buttons that when clicked, added the appropriate field, whether it be a scripture, point, or picture. 

1 Reply


Former Community Member

here is the code for an example I built that uses  subforms one with square textfields one with round

form1.fg.DropDownList1::change - (JavaScript, client)

var yug

var jug

var gug = (yug + jug)

if (xfa.event.newText=="square")

{xfa.form.form1.fg.flw.sqr._sqr2.count = (yug)

xfa.form.form1.fg.flw.sqr._sqr2.addInstance (1)

xfa.form.form1.fg.flw.sqr._sqr2.moveInstance (gug + 1) }

if (xfa.event.newText=="round")

{xfa.form.form1.fg.flw.rnd._rnd2.count = (jug)

xfa.form.form1.fg.flw.rnd._rnd2.addInstance (1)

xfa.form.form1.fg.flw.rnd._rnd2.moveInstance (gug + 1)}


you could use something like that but instead use

image field and a text field in your subforms