how to hide one field and show another field using coral switch? | Community
Skip to main content
Level 4
February 22, 2023
Solved

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

  • February 22, 2023
  • 1 reply
  • 955 views

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"/>

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

1 reply

arunpatidar
Community Advisor
arunpatidarCommunity AdvisorAccepted solution
Community Advisor
February 23, 2023
Level 4
February 23, 2023

@arunpatidar , Thanks. Will look into provided reference.