Search code examples
crafter-cms

Crafter CMS How can a field can be disabled/grayed out in edit mode?


In Crafter 2.5.x. Is there a way to have a dropdown to be selected just one and after selected go to read-only mode?


Solution

  • Not out of the box.

    To accomplish this, you'll need to change the dropdown control by adding a new property, something like Read-write if empty or Read-only if not empty or similar.

    You'll then need to update dropdown.js to respect that field and allow the user to edit the field if the field is empty (meaning the XML element behind it is empty).