I have the JS code working to hide certain fields based upon a dropdown selection on 1 page. On another page using the same code (same fields), I have the information on a tab with other data, including the dropdown selection. When the dropdown selection is = 0, it should hide the fields, but it doesn't. Does something change when the fields are within a tab?
This is the code being used:
var ctrlRental = Runner.getControl(pageid, 'rental');
ctrlRental.on('change', function(){
if (this.getValue() == '1') {
pageObj.showField("tenantname");
pageObj.showField("tenantphone");
pageObj.showField("tenantemail");
pageObj.showField("permaddress");
pageObj.showField("leasestartdate");
pageObj.showField("leaseenddate");
pageObj.showField("document");
} else if (this.getValue() == '0') {
pageObj.hideField("tenantname");
pageObj.hideField("tenantphone");
pageObj.hideField("tenantemail");
pageObj.hideField("permaddress");
pageObj.hideField("leasestartdate");
pageObj.hideField("leaseenddate");
pageObj.hideField("document");
}
})