fixes #5976 Problems trying to enable the mandatory field

Fixed the issue and pushed the code for review, please check it.