Due to popular demand, I added an example that populates fields with information retrieved from a query. It actually has two versions of the code: one using client side JS and one using server side JS.
I created a query in ColdFusion so you do not depend on an external database to run this example. You should be able to easily replace the one I created with a real database.
As usual, I also added it to the download.