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.
SOLVED

Need a script that erases the information in a text box and disables it when a button is clicked

Avatar

Level 6

Good day,

I have two radio buttons that depending on which button is clicked, it disables or enables boxes (text boxes, dates, etc.) so that the user can enter the required information.  The problem is:

If the user clicks the other button after the information is entered in the boxes, the information entered in the boxes remains.  They should be cleared and disabled at the same time.  

Example:  Two buttons - One is "yes", the other is "No".  If yes is clicked, the boxes (Name), (Date), (Reason) is enabled so that they can enter the information.  If the user then click "No" because they changed their mind, the the information in (Name), (Date), (Reason) is disabled and erased and (comments) box is enabled. 

I'm hoping there is a script for this.  I tried the action builder and it's too complicated and not working like I want it. 

 

1 Accepted Solution

Avatar

Correct answer by
Employee
3 Replies

Avatar

Employee

I have implemented the same in the sample form below. Please check and confirm if that is what you are expecting.

 

Sample Form: https://drive.google.com/file/d/17-bYoAXdtMEp2lUFQ97EnR0DRgMKKhFg/view?usp=sharing

 

Avatar

Level 6

Yes.  This is what I want.  Only one thing.  I would like whatever is entered in the comments section to be removed when I click the yes button again.  it doesn't do that.  It's disabled but the comments remains.

Avatar

Correct answer by
Employee

I have done the same in the form below. Please check and confirm.

https://drive.google.com/file/d/17-bYoAXdtMEp2lUFQ97EnR0DRgMKKhFg/view?usp=sharing