views:

35

answers:

1

I'm trying to create an ajax form with jQuery. I'd like to load existing values into the different form fields (text boxes, dropdown menus). Would I use JSON for this? And how would I load the values? Iterate through the JSON and for each entry load the corresponding value? How would this be done?

Thanks in advance.

+1  A: 

Is there a reason that your are not loading them in from your server side code?

The overhead of converting into JSON and then loading into the form using JavaScript/jQuery would be much greater that simply populating them with server-side script code. Not to mention adding the requirement that any browser must have Javascript turned on to view your page.

James Wiseman
It's going to be used for an intranet application, I am trying to avoid refreshing the page
Jo
@Jo you can still load the entire form with ajax and server side code without refreshing the page.
Brandon H