How to define the options for a checkbox field from the previously filled field?