Disable form field if it has value

Hello, is there a way to disable form field on edit page if for example it is not empty or it has a certain value. I'm trying to use a disabled function but I'm not sure how to get the model values into the condition.
Any help appreciated!
Was this page helpful?