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
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("
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
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.
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.
Copy link to clipboard
Copied
"MyRadio" is name of radio button.
Why exactly are you trying to use radio button?
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.
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;
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!!!
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.
Copy link to clipboard
Copied
... off automatically.
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;
Copy link to clipboard
Copied
THANK-YOU AGAIN... the last script does EXACTY what I was looking for. Much appreciated.