Copy link to clipboard
Copied
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.
The code I provided will do that.
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
The code I provided will do that.
Copy link to clipboard
Copied
hola
TenÃa razón
muy amable
Feliz Navidad y Próspero Año Nuevo
MuchÃsimas Gracias