making a field in a row not editable conditionally

what's the best solution for making a field in a table row not editable based on a value.  For example...I only want to allow the user to enter a percentage if the team member role is equal to External Sales.  Also, if the user changes the role from let's say Sales Admin to External Sales the percentage should be blanked out and made read only.


I recommend checking out this tutorial page to see how to make fields read, read only, or edit on a table.