How to disable the DropDown and "Allow Add"?
Hi I am using the bellow code to disable the field "Kostenstelle"
This is working fine.
But the the field is a select modal dialog lookup field and has + button (allow Add) too.
How can I also disallow the options?
Right now the field is disabled but the suer can still have the modal lookup and add a new record into lookup table.
Any idea where to start?
// Page_Load event
function Page_Load() {
// Get the current value of 'Kostenstelle'
$currentKostenstelle = $this->Kostenstelle->CurrentValue;
// Check if 'Kostenstelle' is not null or empty
if ($currentKostenstelle !== null && $currentKostenstelle !== '') {
// Query the database to get the 'ks_gueltig' value for the given 'Kostenstelle'
$ks_gueltig = ExecuteScalar("SELECT ks_gueltig FROM kostenstelle WHERE ksid = " . $currentKostenstelle);
// If 'ks_gueltig' is 0, disable the 'Kostenstelle' field on the Edit page
if ($ks_gueltig == 0) {
$this->Kostenstelle->EditAttrs["disabled"] = "disabled";
}
}
}
mpol_ch