Hi,
I have been trying to hide two fields input and its labels for a visualization and edit form and have only had success for the input. I have the following code:
$(document).ready(function() {
var sociedad = $("#cr027_sociedad").val();
//Sociedad == "Banco"
if(sociedad == 212520000){
$(".section[data-name='Fundacion_Universia_tab']").closest("fieldset").hide();
$(".section[data-name='Pais_tab']").closest("fieldset").hide();
}
//Sociedad == "Fundacion"
else if(sociedad == 212520002){
$(".section[data-name='Pais_tab']").closest("fieldset").hide();
$("#cr027_cuenta").style.display = 'none';
//$("#cr027_cuenta_label").style.display = 'none';
$("#cr027_presupuesto").style.display = 'none';
//$("#cr027_presupuesto_label").style.display = 'none';
}
//Sociedad == "Pais"
else {
$(".section[data-name='Fundacion_Universia_tab']").closest("fieldset").hide();
$("#cr027_cuenta").style.display = 'none';
//$("#cr027_cuenta_label").style.display = 'none';
}
});
The fields names are cr027_cuenta and cr027_presupuesto. In the case of the visualization form, when uncommented, it only hides the input, leaving the label behind. Using the same name with "_label" doesn't work either.
When trying this on the edit form it doesn't do anything at all.
Thanks in advance.