开发者

How can I load values into an HTML form with jQuery?

开发者 https://www.devze.com 2022-12-18 07:03 出处:网络
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 value

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.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消