Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Adobe Summit 2023 [19th to 23rd March, Las Vegas and Virtual] | Complete AEM Session & Lab list
SOLVED

how to hide one field and show another field using coral switch?

Avatar

Level 4

i tried like this but could not work

<switch
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/form/switch"
fieldLabel="Toggle Field"
name="./mySwitch"
granite:data-showhidetarget=".toggleField"
granite:data-showhidetargetvalue="true,false"
granite:class="coral-Form-field"/>
<textfield1
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/form/textfield"
fieldLabel="Field to Hide"
name="./fieldToHide"

granite:class="toggleField coral-Form-field"/>
<textfiel
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/form/textfield"
fieldLabel="Field to Show"
name="./fieldToShow"

granite:class="toggleField coral-Form-field"/>

 

1 Accepted Solution

Avatar

Correct answer by
Community Advisor
2 Replies

Avatar

Correct answer by
Community Advisor