How do I get the border on radio buttons to only appear on the selected button

Hi I am very new to PDF forms and Javascript. Firstly I would like to say thankyou, this site has been a wealth of information. Is there a way to have the border appear only on the radio button that is selected? I have a group (package type) with 3 options (Electronic/Standard/Premium)


Rose Miceli


2 Answers

Voted Best Answer

Just as a quick and dirty hack, I could get this to work:

Create an additional text field (read-only, hidden), and add the following script to the Calculate event (note that you have to replace "Group4" with the correct field name, and also note that the period after the field name must be maintained):

for (var i = 0 ; i < 4 ; i++) {
if (this.getField("Group4").isBoxChecked(i) == true) {
this.getField("Group4." + i).strokeColor = color.black ;
this.getField("Group4." + i).lineWidth = 0 ; // change for visual effect
} else {
this.getField("Group4." + i).strokeColor = color.transparent ;
this.getField("Group4." + i).lineWidth = 0 ;
}
}

You can get an even stronger visual effect when you set the lineWidth to 1, 2, or 3 in the marked line. When the value is set to 0, all you will see is the symbol, but no border (or just artefacts of the border).

You may have to adjust the field sizes.

Hope this can help.

Max Wyss.


By Max Wyss   

How would your users know that there is something to click on if there is no border for the radiobutton? Or is that visual information from the base document?

Max Wyss.


Max Wyss   


Please specify a reason: