使用php和ajax自动填写表单

I've a simple table on mysql like this

----------------
id | film | year
----------------
1  | xxxx | 2000
----------------
2  | yyyy | 2001
----------------

I'd like to create a form with 3 fields that when i put the number 1 in the field ID it gives to me automatically xxxx in the field "film" and "2000" in the field year.

I know how to do it with a php Post but i need it without button

all you need to do is have the onchange flag in the html elements and have that pass its data and what field it is to a javascript ajax handler that sends a post to a php script that hits the database with your query and returns the data to javascript which can then be used to populate the Fields.