How to disable fields based on conditions.