Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.

Disabling Buttons


Former Community Member

I am just wondering if it is possible to enabled / disable buttons at runtime.

The scenario is that I have a form with a large number of questions. Some of these questions have sub questions depending on the users choice. I would like to be able to display the sub questions but have them inactive until the user clicks 'no' on radiobutton.

I have been able to gray out all the fields and the button as well as set all the fields as readOnly. I don't seem to be able to stop the button's onclick event though.

Does anyone have any ideas?

Kind Regards

Mike Beaton
4 Replies


Former Community Member
Setting the button's access property to "readOnly" would make it unclickable.

Button.access = "readOnly";


Adobe Enterprise Developer Support


Level 2

so how do u enable it back after setting it to read only, whats the code?


Former Community Member
Thanks Chris

How stupid do I feel....