开发者

Saving selected values w/jQuery

I have a form with multiple rows, each one of which contains a checkbox with item ID. The form is long and is broken into several pages.

How do I select multiple checkboxes, while going from page to page, before submitting the form?

The paging is actually done with PHP, but I do not want to submit until I am done with selection. Also, if I go back to the previous page I need to check the one开发者_开发技巧s that have been previously selected.

I use jQuery on this site, so I thought it could be accomplished with it. Perhaps there's a pludin for that already?..

What's the best way to implement this feature? Thx.


I think that the best way to do that would be to submit the data to PHP and store it into session: this way it's not committed to the database but is saved across the browsing session.

This is of course because you are telling us that the different pages are generated by php so i suppose you navigate from one page to another

To that only client side you should use cookies i think. you could start here but i really think you should do it server side


You could use session to save the state of your checkboxes. There is a plugin for jquery "jquery.namesession" that will help you to manipulate your session variables using JS.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜