Posts

AEM show/hide enable/disable dialog fields based on Checkbox

Image
Hello All, While developing AEM components we might need to show/hide or enable/disable fields in dialog based on Checkbox or on Select dropdown. I implemented this for Touch UI dialog in AEM 6.5. Thanks to my friend Sameer Gunjal who helped me here. Requirement : On the basis of checkbox, We are going to enable/disable textfields of the dialog. Steps:   Add Granite:class to the checkbox node and to the fields you want to disable.  Remember, We are going to use these same classes in JS.   2      Create a clientlib, to place our JS file in it.                     I have created a JS file with name listeners.js,        Put below JS in the file that you created.        (function($) {    "use strict";    $(document).on("dialog-ready", function() {    $(document).on('change', '.checkbox-test', chekbxt);     if( $('.checkbox-test').length > 0 ) {       chekbxt();