1

I'm making a simple form in AEM 6 and want to autopopulate some fields based on a response in other fields. For example: I made a drop down list with options 0=red and 1=black and below it I made a text box. I want the text box to be autopopulated with red or black based on the option selected in the drop down list.

This is how my setup looks at the moment:

enter image description here

I dug in the code and in the file content/forms/af/geometrixx-gov/applicaiton-for-assistance/.content.xml I see the following:

      <guidedropdownlist_0
                            jcr:created="{Date}2015-04-23T21:06:53.236-04:00"
                            jcr:createdBy="admin"
                            jcr:lastModified="{Date}2015-04-23T21:12:29.957-04:00"
                            jcr:lastModifiedBy="admin"
                            jcr:primaryType="nt:unstructured"
                            jcr:title="Drop-down list"
                            sling:resourceType="fd/af/components/guidedropdownlist"
                            assistPriority="custom"
                            guideNodeClass="guideDropDownList"
                            name="dropdownlist_0"
                            options="[0=red,1=black,2=blue]"/>
                        <guidetextbox_5
                            jcr:created="{Date}2015-04-23T21:12:51.050-04:00"
                            jcr:createdBy="admin"
                            jcr:lastModified="{Date}2015-04-23T21:12:51.050-04:00"
                            jcr:lastModifiedBy="admin"
                            jcr:primaryType="nt:unstructured"
                            jcr:title="Text box"
                            sling:resourceType="fd/af/components/guidetextbox"
                            guideNodeClass="guideTextBox"
                            name="textbox_5"/>

Is this possible to accomplish?

birdy
  • 9,286
  • 24
  • 107
  • 171
  • May be this link will be helpful :http://docs.adobe.com/docs/en/cq/5-6-1/developing/developing-forms.html#Showing%20and%20Hiding%20Form%20Components – Vivek Dhiman Apr 25 '15 at 06:35

1 Answers1

0

You can use listeners for your dropdown element. You just need to implement the function for the 'selectionchanged' event.

Here is a similar question: In cq5 widget hide and show based on checkbox in dialog

You may also take a look at Adobe CQ Widgets API documentation, in order to see what events are available for your particular xtype:

https://docs.adobe.com/docs/en/cq/5-5/widgets-api/index.html

Community
  • 1
  • 1
Gabi
  • 687
  • 1
  • 7
  • 18