fill a text field, depending on the value selected in a combobox

Hello everyone
I want to know how can i fill a text field automatically, depending on the value selected in a combobox ?

Thank you for help

Hello,

Checkout the functionality in opportunity module for sales_stage field.

You can check file modules/Opportunities/views/view.edit.php

I explain more ,
I have a department that is managed by a single buyer, and every buyer belongs to a single team
So I want, when I select the department,the other two fields namely:
the buyer
and the team
will automatically tuck, and it had the effect (it binds) in the database also

Go through this