I want to add hidden value on base if user selected

I am trying to add a type (new or old) field based on another field. for example if selected user is A or B i want to add type equal to new and if selected user is D or E or F i want type field equal to old. and insert the data.

Please me help thanks

Take a look here and tell us if this is what you want.