text radiobutton transparent

New Here ,
Nov 23, 2021 Nov 23, 2021

Copy link to clipboard

Copied

Hi there, I'm looking for a way to make the text within a radiobutton transparent when chosen to still see an underlying image. Alternatively, I assume, one could make the image transparent and send the radiobutton to the back, but I do not know how to do that, either. Any ideas? (I do not know anything about javascript, please write your reply for dummies). Cheers, Hendrike

TOPICS
How to , JavaScript

Views

132

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Adobe Community Professional , Jul 02, 2022 Jul 02, 2022

If you have two buttons and want them to be mutually exclusive when changing border color you need to access their individual widget, for example if they are named "Group1" first button is "Group1.0" and second is "Group1.1".

Try something like this:

For button "Yes":
event.target.value = "Off";
if(color.equal(this.getField("Group1.0").borderColor,color.transparent)){
this.getField("Group1.0").borderColor = color.red;
this.getField("Group1.1").borderColor = color.transparent;}
else if(this.getField("

...

Likes

Translate

Translate
Adobe Employee ,
Nov 23, 2021 Nov 23, 2021

Copy link to clipboard

Copied

Hi Hendrike,

 

Hope you are doing well.

A radio button appearance can be defined following the steps suggested in the help article here: https://helpx.adobe.com/acrobat/using/setting-action-buttons-pdf-forms.html#specify_acrobat_button_d... 

 

To setup a radio button border color transparent, here is a similar discussion with the JS script. Please review it: https://community.adobe.com/t5/acrobat-discussions/set-radio-button-border-color-to-transparent-save... 

 

Thanks,

Akanchha

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Nov 23, 2021 Nov 23, 2021

Copy link to clipboard

Copied

Unlike the border and fill color, the field text color cannot be set to transparent. But you can make it so small that it can't be seen. 

this.getField("MyRadio").textSize = 0.001;

 

A field's drawing position cannot be controled with a script. 

 

Thom Parker - Software Developer at PDFScripting
Use the Acrobat JavaScript Reference early and often

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 30, 2022 Jun 30, 2022

Copy link to clipboard

Copied

Thom, in your example... what is "MyRadio" ?

I am trying to use this but as of yet have not been successful.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Jun 30, 2022 Jun 30, 2022

Copy link to clipboard

Copied

"MyRadio" is name of radio button.

Why exactly are you trying to use radio button?

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 01, 2022 Jul 01, 2022

Copy link to clipboard

Copied

I have a number of forms that require circling yes or no answers.  I want to click yes or no thereby putting a circle around the original text on the form.  I assumed that "MyRadio" was the name but when substituting my Group and or button choice the text will not reduce to .001.  The circle portion works but the inner white text blocks view of the original form text.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Jul 01, 2022 Jul 01, 2022

Copy link to clipboard

Copied

There are other ways to achive that.

1. Go to radio button properties -> appearance tab and set 'line style' to solid and set border color to 'No color'.

2. As Mouse UP event of radio button add this script:

event.target.value = "Off";
event.target.borderColor = color.equal(event.target.borderColor, color.transparent) ? color.red : color.transparent;

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 01, 2022 Jul 01, 2022

Copy link to clipboard

Copied

That did the trick.  Thank-you much!!! I thought I tried something similar to that previously but no doubt I had something wrong.  Thanks again!!!

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 02, 2022 Jul 02, 2022

Copy link to clipboard

Copied

I didn't notice earlier that they are not responding as radio butons but are both on/off which is good for multiple choices to be allowed but in the case of yes/no I was hoping for true radio buton operation to force the other choice of automatically.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 02, 2022 Jul 02, 2022

Copy link to clipboard

Copied

... off automatically.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Jul 02, 2022 Jul 02, 2022

Copy link to clipboard

Copied

If you have two buttons and want them to be mutually exclusive when changing border color you need to access their individual widget, for example if they are named "Group1" first button is "Group1.0" and second is "Group1.1".

Try something like this:

For button "Yes":
event.target.value = "Off";
if(color.equal(this.getField("Group1.0").borderColor,color.transparent)){
this.getField("Group1.0").borderColor = color.red;
this.getField("Group1.1").borderColor = color.transparent;}
else if(this.getField("Group1.0").borderColor = color.red)
this.getField("Group1.0").borderColor = color.transparent;
For button "No":
event.target.value = "Off";
if(color.equal(this.getField("Group1.1").borderColor,color.transparent)){
this.getField("Group1.1").borderColor = color.red;
this.getField("Group1.0").borderColor = color.transparent;}
else if(this.getField("Group1.1").borderColor = color.red)
this.getField("Group1.1").borderColor = color.transparent;

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 02, 2022 Jul 02, 2022

Copy link to clipboard

Copied

LATEST

THANK-YOU AGAIN... the last script does EXACTY what I was looking for.  Much appreciated.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines