Disable textfield if not empty in cq dialog | Community
Skip to main content
maynors2427659
Level 2
September 5, 2018
Solved

Disable textfield if not empty in cq dialog

  • September 5, 2018
  • 1 reply
  • 2010 views

I want to call a JS function on load of cq dialog to validate if a field already has something, if so, disable it from edition. I have tried with validation but it is called after the users interacts with the field, I need a way to do it before, when is being loaded. It is possible?

<id
   jcr:primaryType="nt:unstructured"
   sling:resourceType="granite/ui/components/coral/foundation/form/textfield"
   fieldLabel="ID"
   validation="is_empty"
   name="./id"
   required="{Boolean}true"/>

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

Just confirmed with our Touch UI experts - they replied:

just listen to dialog-ready event and disable, something like

$document.on('dialog-ready', function(){

//get and disable here

});

More info -- Adobe Experience Manager Help | Using Event Handlers in Adobe Experience Manager Touch UI Components

1 reply

smacdonald2008
smacdonald2008Accepted solution
Level 10
September 5, 2018

Just confirmed with our Touch UI experts - they replied:

just listen to dialog-ready event and disable, something like

$document.on('dialog-ready', function(){

//get and disable here

});

More info -- Adobe Experience Manager Help | Using Event Handlers in Adobe Experience Manager Touch UI Components