disable Date for non admins
Posted: 2022-07-26 16:47
Hi I have tried to disable the date field (it has 3 drop downs, one for day, one for month and one for year) for non admins but have had no success. I have another field that needs to be disabled and it is working ok. Just cant get the Date to be disabled.
Has anyone got this working and could share it with me?
This is a part of the code I am using in the hooks file under function tablename_dv
I have tried the following by looking at the dml file
this didnt work either.
Has anyone got this working and could share it with me?
This is a part of the code I am using in the hooks file under function tablename_dv
Code: Select all
$html .= <<<EOC
<script>
\$j(function(){
\$j('#Name').prop('readonly', true);
\$j('#Date').prop('readonly', true);
})
</script>
EOC;
Code: Select all
\$j('#DateDay').prop('disabled', true)
\$j('#DateMonth').prop('disabled', true)
\$j('#DateYear').prop('disabled', true)