Skip to main content
alobened
Participating Frequently
December 13, 2018
Answered

radio button - adobe acrobat

  • December 13, 2018
  • 1 reply
  • 798 views

Hola

Tengo varios radio button y me gustaría poder activarles por JavaScript.

selecciono cualquier provincia y me gustaría que automáticamente  el radio button quedase marcado, activado.

un saludo y muchas gracias.

This topic has been closed for replies.
Correct answer try67

The code I provided will do that.

1 reply

try67
Community Expert
Community Expert
December 13, 2018

You can tick a specific radio button by setting the field's value to its "Radio button choice".
For example, if the value is "1" and the name of the field is "RadioButton1", you can do it like this:

this.getField("RadioButton1").value = "1";

To make it dependent on the value of the drop-down you can use the following as the custom validation script of the drop-down field:

if (event.value=="AVILA") this.getField("RadioButton1").value = "1";

else if (event.value=="MADRID") this.getField("RadioButton1").value = "2";

else if (event.value=="TOLEDO") this.getField("RadioButton1").value = "3";

else this.getField("RadioButton1").value = "Off"; // the default value when nothing is selected

alobened
alobenedAuthor
Participating Frequently
December 13, 2018

hola

muchas gracias por la ayuda tan rápida.

pero la idea es mas simple.

solo quiero que se marque el botón como activo

try67
Community Expert
try67Community ExpertCorrect answer
Community Expert
December 13, 2018

The code I provided will do that.