View Full Version : How to pre-populate several textfields from JSON thats from PHP file.

25 Mar 2011, 9:28 AM
i, I am having trouble implementing a onLoad to populate several textfields
from saved user settings in a database.

I have four textfields, all are to specify a user's info (First Name, Last Name, Age, and City)

I know I have to write a php file that would load it from the database and echo it
out in a json format. I know how to do that.

Now my problem is, I don't know how to access the JSON and programmatically set the 4 textfields with the data from the JSON when the cards Loaded.

Please provide some incite into this and thanks in advance for your help.


25 Mar 2011, 2:30 PM
Take a look at Ext.form.FormPanel.loadRecord();

I've used that many times before and just as a suggestion it might be a good idea to add a hidden 'id' field if it applies to your situation.