Selecting a field from another table

I have 2 tables.

  1. table is customer details (name, adress, email)
  2. table i want to select box in customer name. If i select customer name, customer adress and email must come auto.
    how can i do this. Thanks

You must have an ajax event onchange for field select box customer name.
in this event you must create your query. and assign the values for your fields.

i did create a form look like sample form49. Select state and city name listed.
but i have a big form. I want to add same system to my form, but this events on change not work in my form. If i create form only for state ant city works, but when i add the same codes to my form it doesn’t work