Combobox , Value to Textbox

I have a combobox and a test box when I choose a value from combobox ajax wanted by the value of the comboboxgoes to the textbox, it seems so simple but is not working, if I write in the textbox after making the onchange comboboxclears the textbox to do so this refresch the textbox but does not pass the value of the combobox into the textbox,
Anyone can help.
Just attached a example. I think this is what you want.

Hi Carlos

doing a quick search on the community you can find several topics around the same problem and in the most of the cases the problem is related with the assign value to the right variable when you're refreshing the item you want to show the value.

EDIT: for more details on combobox see this tuturial

OK, Thanks
Luis Oliveira,
Is not working for my project.
The example realized by assigning variables of type tex, but I'm to fill a combobox with the value of a record list which comes from a query in onchange of combo before, and I do not know where to put the variable, when I tried to gave me : after choosing a value in the combobox, appeared in the textbox ,last value record.list