Hi guys,
to hide some fields when inserting in function of a certain value in the lookup field I found this solution in the forum.
var ctrlAttivita = Runner.getControl(pageid, 'Attivita');
var ctrlDato = "Visita";
var ctrlDato1 = "Catalogo";
ctrlAttivita.on('change', function(e){
if (this.getValue() == ctrlDato){
document.getElementById("hidediv1").style.display="none";
document.getElementById("hidediv2").style.display="none";
document.getElementById("hidediv3").style.display="none";
}
});
I need also to change the HTML using this code.
{BEGIN Importo_fieldblock}<TR id=hidediv3 class=...
This funcion run well but have some problems.
When I try to edit o view the record informations that have the I see the labels and the fields.
In fact, when I edit a field that has that particular value of the fields are not hidden.
There is an alternative to avoid even in this case that filed is invisible?
Example:
I do not need to see in the next field "AMOUNT" when I choice "VISIT" in the previous lookup field.
In this case, this code works fine.
But if I need to edit a record that has already registered with the choice "VISIT", the field "AMOUNT" is still displayed.
I hope I was clear
Many thanks in advance for your help.