Expand my Community achievements bar.

Radically easy to access on brand approved content for distribution and omnichannel performant delivery. AEM Assets Content Hub and Dynamic Media with OpenAPI capabilities is now GA.

Edit Radio Button Properties via FormCalc

Avatar

Level 2

Hi everyone, I'm have trouble figuring out how edit Radio Buttons in my script. I just want to be able to change the presence and the caption next to them. Basically the user will click a button, a response box pops up, then the radio button makes the text from the response box it's caption and changes the presence of the button to visible. I've tried using Object.#field.presence = "visible" but it's not working. I had it working before but designer crashed afterward and I don't remember what I did. I don't know why they make it so difficult to do something as simple as editing properties via script!

Any help would be greatly appreciated

8 Replies

Avatar

Level 10

Usually you can use the presence property directly followed by the control's name.

     RadioButton1.presence = "visible";

Not sure why this is giving error.. May be you can check the name that was given to the Radio Button. you can find it by selecting the control and open the Heirarchy palette and provide a proper name. And use the name in the above command.

Thanks

Srini

Avatar

Level 2

I am doing that, even going through the ridiculously long heirarchy.

xfa.form.form1.subForm.Area1.area.presence = "visible"  is not working

Area1 is the radio button group and area is the one button inside that group, as I'm essentially just using radio buttons as checkboxes. This is so frustrating!

Avatar

Level 10

Can you send the form to LiveCycle9@gmail.com so I can have a look at it..Please mention where the issue is..

Thanks

Srini

Avatar

Level 10

Few things missing in your form..

a) You did not make the form as dynamic.Do the following to make it dynamic.

     1) Goto File menu -> Form Properties and select Defaults tab. Change the Default Render Format as Dynamic XML form

     2) Select the Preview Tab. Set the Preview type as "Interactive Form" and Preview Adobe XML form as Dynamic XML form

     3) Finally while saving the PDF select Save As Type as "Adobe Dynamic XML Form".

b) In the click event of the button change the code like below..

     var customArea = xfa.host.response("Enter your additional area to be serviced", "Custom Area");
     form1.subForm.Area1.area.presence = "invisible";

     (OR)

     form1.subForm.Area1.area.presence = "hidden";

It should hide the area radio button.

Other observation.. You did not name the rest of the radio buttons on your form.. Having a proper name for the Radio buttons will help you in scripting.

RadioButton Issue.jpg

Thanks

Srini

Avatar

Level 2

I am using Adobe Designer, and am not seeing an option for render format in the properties. I'm aware that nothing is named yet, I was going to name them as I programmed each button but I can't get the functionality working. I am doing exactly what you're saying and it's not working idk what to do!

Avatar

Level 10

Here is the form that I have modified..

https://acrobat.com/#d=l5YHedvW0-AE2u0BrKgyGw

Let me know if this helps.

Thanks

Srini

Avatar

Level 2

Yes that helped thank you so much! Now my problem is figuring out how to change the text of the radio buttons from the script, any idea on how to do that one?

Avatar

Former Community Member

The expression you want to use to get at the caption is:

RadioButtonList.NameOfYourRadioButton.caption.value.text.value

Paul