How to automatically insert a value to a field when an option on a previous field is selected?