AutoPopulate form elements from an OnChange option using Ajax/mySQL/JavaScr - TechRepublic
Question
March 13, 2009 at 11:44 AM
pcinfoman

AutoPopulate form elements from an OnChange option using Ajax/mySQL/JavaScr

by pcinfoman . Updated 16 years, 10 months ago

I have database with 18 tables in it. There is over 550 records in this table. The PRIMARY table in the db is “stock_no”. There are never any duplicate values in it (hence the “PRIMARY”).

I have a web form at http://www.animalmakers.com/Testing/db_updateexisting.php that 18 fields on it (one for each db table). The “id” and “name” values of each field are exactly the same as the name of the table in the db. 4 of these fields are pull-down menus that are populated from the database.

What I need to do is have it so when the “stock_no” field on the form changes, it queries the db and fills out the form with the results from the db.

How can this be done? Does somebody has some ready javascript/ajax/php coding that I can modify for my purposes?

This discussion is locked

All Comments