开发者

multiple hidden forms

I have a php mysql application. On a detail view page, I am looking at rows of data. I want to use jquery form plugin to do form submitting.开发者_如何学JAVA What I am not sure of is that i need to have a hidden form for every record in case they want to update a certain bit of data. Im not sure how i should create the form. Should the form be hidden and contain an unique id of each hidden form? Should i create the form using an ajax request to create the form by passing the same parameters that i would have used in create the forms once at page load? Should i create the form values on the fly?

What is a good practice for having hidden forms or dynamic forms using jquery form plugin. This could also be a terribly worded question.


If you're using AJAX to post forms, you don't even need a form on the page. You just need to tell your AJAX post code which fields you want to use, serialize them and then post to the server.

You can use class names to signify which fields belong to which "virtual form" to make it easy to collect your form data for each POST type.


There is a great deal of benefit to the concept of model binding. If you have many fields, hiddens, etc. that rely on the input of other fields, perhaps a library like Knockout would help. It integrates very nicely with jQuery. http://knockoutjs.com/

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜