[SalesForce] write a validation rule to make a field enabled or disabled based on picklist value

Note: in standard page layout

is it possible to write a validation rule to make a field enabled or disabled based on picklist value?

i have a picklist – values

             cycle - monthly
                     quaterly
                     semi annual
                     annual
                     other

if picklist value is other a text field days has to be enabled

how can i achieve this?

thanks in advance

Best Answer

You can use the validation rule to make sure that the record cannot be saved unless the Days text field is filled in if the picklist value is 'other'.

AND(
    ISPICKVAL(Cycle__c, "other"),
    ISBLANK(Days__c)
)

This will give the user an error if they try to save a record where the picklist value os other and the days field is left blank.

You cannot though control whether or not the days field is enabled though. You would need a visualforce page to accomplish this functionality.