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.

**HELP** Check Box makes two options for a Text Field if on or off

Avatar

Level 2

I have a PDF Form with a single check box that can be turn on and off. I want to have the option of wether its on or off, it will change the text inside of a text field which appears next to it. But if never touch as if the form was just open, I want it to remain blank.

Can anyone please tell me how to do this. Thanks!

I.E. If the check box is on, the text field next to it will auto populate with " Your request is accurate". If the check box is off, the same text field will auto populate with "No request submitted".

4 Replies

Avatar

Former Community Member

Sounds like you want a tri-state checkbox. By default it only has two states (On/Off). Make sure the checkbox has focus and in the Object palette you can select the On/Off/Neutral option (see image below):

screen1.png

This will allow you to define an on/off and neutral value (see teh binding tab).

Also you can set the Default value in the Value tab (in your case you probably want it set to neutral).

You will probably have to modify your code on the button to deal with this 3rd option

Paul

Avatar

Level 2

Ok did that, now how do I make the text field that I have next to the check box change depening on what the user has clicked on the check box? I'm guessing I need to mess with the text?

Avatar

Former Community Member

Thought you had the code part worked out already .......sorry!

Here is a sample that shows how to deal with it. There is code on the change event of the checkbox and the button is there to reset the form (to test the 3rd condition).

Paul

Avatar

Level 2

This worked perfectly! Thanks!