Expand my Community achievements bar.

SOLVED

programming radio buttons

Avatar

Level 2

Right now I'm able to choose between "Maintain" and "Correct" and between "Left" and "Right", but what I would like to do is that only if I choose the "Correct" option, I will have the option to choose between "Left and "Right" (although "Left" and "Right" don't have to be invisble). I have no experience in programming JS, so I would be really happy if you could help me using a simple method.Clipboard01.jpg

Another unrelated question: As you can see I have an underline textbox where I should input the mm. The underline is very low because only this way the typed text would be aligned to the "left" and "mm". Is there a way to raise the underline without raising the place for the typed text?

Thank you in advance

1 Accepted Solution

Avatar

Correct answer by
Level 10

Hi,

Have a look at this example which shows how to use the presence property to show and hide objects: http://assure.ly/h7whb8.

There are also some examples here:

https://acrobat.com/#d=ALebgueDXjewHjGyYRdrmw

https://acrobat.com/#d=FXLq025O2C0aDMh9YqpH1g

Basically you would place the following script in the click event of the radio button exclusion group:

if (this.rawValue == "Correct") {

     direction.presence = "visible";

}

else {

     direction.presence = "invisible";

}

This is on the basis of the Left and Right radio buttons being inside a radio button exclusion group called "direction". Also if you have specified a value in the Object > Binding palette for the radio buttons, the script would need to test this value. 

You can adjust the textfield margins in the Layout palette, so that the underline is raised up. Trial and error.

Niall

View solution in original post

4 Replies

Avatar

Correct answer by
Level 10

Hi,

Have a look at this example which shows how to use the presence property to show and hide objects: http://assure.ly/h7whb8.

There are also some examples here:

https://acrobat.com/#d=ALebgueDXjewHjGyYRdrmw

https://acrobat.com/#d=FXLq025O2C0aDMh9YqpH1g

Basically you would place the following script in the click event of the radio button exclusion group:

if (this.rawValue == "Correct") {

     direction.presence = "visible";

}

else {

     direction.presence = "invisible";

}

This is on the basis of the Left and Right radio buttons being inside a radio button exclusion group called "direction". Also if you have specified a value in the Object > Binding palette for the radio buttons, the script would need to test this value. 

You can adjust the textfield margins in the Layout palette, so that the underline is raised up. Trial and error.

Niall

Avatar

Level 2

I have no clue in programming, so it seems I am unable to apply the direction to the specific buttons...

Avatar

Level 10

Hi,

I am out at the moment and can't access/provide any example or screenshot.

However please note that "direction" in my script is what I have assumed you have called the radio button exclusion group that contains the Left and Right radio buttons. If you have called this something different, then just replace "direction" with the actual name.

Hope that helps,

Niall

Avatar

Level 10

Hi,

Here is your form back to you with the script in the click event of the radio button exclusion groups: https://acrobat.com/#d=l5u-5d4BF-HFZ-nfS5rP8g.

Also, just for clarity, I would recommend setting up your workspace with the main palettes available. In particular extending the script editor (5) down:

LC Designer Workspace.png

For the distances, I have changed this from a textfield to a numericfield and set the Display Pattern to include the units (see the Object > Field palette).

Hope that helps,

Niall