Hello,
I need to set a radio element without any default value, just two options with values 1 and 2. Based on selection made to this element, another elements will be shown/hide.
The code from below work fine for new records, but when i edit the form, the elements that should be visible based on the selection made are hidden and in console.log i get the value: 'undefined' for the radio element.
I don't know how to force the element to use the selected value instead of default value.
This is the code:
Thank you
I need to set a radio element without any default value, just two options with values 1 and 2. Based on selection made to this element, another elements will be shown/hide.
The code from below work fine for new records, but when i edit the form, the elements that should be visible based on the selection made are hidden and in console.log i get the value: 'undefined' for the radio element.
I don't know how to force the element to use the selected value instead of default value.
This is the code:
JavaScript:
var cws = Fabrik.getBlock('form_166').elements.get('contracte_campuri___configurare_wireless_standard');
var vws = Fabrik.getBlock('form_166').elements.get('contracte_campuri___valori_configurare_wireless_standard');
var vrs = Fabrik.getBlock('form_166').elements.get('contracte_campuri___valori_configurare_router_standard');
switch (this.get('value')){
case 1:
cws.show();
vws.show();
vrs.show();
break;
case 2:
cws.hide();
vws.hide();
vrs.show();
break;
default:
cws.hide();
vws.hide();
vrs.hide();
}
Thank you