Show/Hide Fields Based On Dropdown Selection - AEM 6.5
Hi team,
Please help me, regarding show/hide fields based on the dropdown selection in the dialog box
---------------------------------------------------------------------------------------------------------------------------
In the dialog box, I have a two fields
1. Dropdown
2. NumberField
The dropdown has 6 values
- none
- firstValue
- secondValue
- thirdValue
- fourthValue
- fifthValue
When dropdown selection is "none", the number field is not shown
When dropdown selection is any other value (firstValue, secondValue etc), the number field is shown
please help me with this code block
<dropDown
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/form/select"
granite:class="cq-dialog-dropdown-showhide"
fieldLabel="dropDown"
name="./dropDown"
required="{Boolean}false"
type="editable">
<items jcr:primaryType="nt:unstructured">
<none
jcr:primaryType="nt:unstructured"
text="None"
value="none"/>
<firstValue
jcr:primaryType="nt:unstructured"
text="First Value"
value="firstValue"/>
<secondValue
jcr:primaryType="nt:unstructured"
text="Second Value"
value="secondValue"/>
<thirdValue
jcr:primaryType="nt:unstructured"
text="Third Value"
value="thirdValue"/>
<fourthValue
jcr:primaryType="nt:unstructured"
text="Fourth Value"
value="fourthValue"/>
<fifthValue
jcr:primaryType="nt:unstructured"
text="Fifth Value"
value="fifthValue"/>
</items>
<granite:data
jcr:primaryType="nt:unstructured"
cq-dialog-dropdown-showhide-target=".dropDown-showhide-target"/>
</dropDown>
<numberField
granite:class="heroFilter-showhide-target"
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/form/numberfield"
fieldLabel="Number Field"
name="./numberField"/>
<granite:data
jcr:primaryType="nt:unstructured"
showhidetargetvalue=""/>
