Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

radio button - adobe acrobat

Explorer ,
Dec 13, 2018 Dec 13, 2018

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.

TOPICS
Acrobat SDK and JavaScript , Windows
702
Translate
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

Community Expert , Dec 13, 2018 Dec 13, 2018

The code I provided will do that.

Translate
Community Expert ,
Dec 13, 2018 Dec 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

Translate
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
Explorer ,
Dec 13, 2018 Dec 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

Translate
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
Community Expert ,
Dec 13, 2018 Dec 13, 2018

The code I provided will do that.

Translate
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
Explorer ,
Dec 13, 2018 Dec 13, 2018
LATEST

hola

Tenía razón

muy amable

Feliz Navidad y Próspero Año Nuevo

Muchísimas Gracias

Translate
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