开发者

Convert form with dynamic element to support back button history

I have a form. For simplicity, let's say there's a list and you can pick from开发者_如何学Python the list and press Add, which appends the item in the list into an HTML element with hidden <input> elements so the values submit. jQuery works fine for htat,

When I submit the form, fine. However, using the back button reverts the page to the initial page state.

I've read a number of posts on SO (https://stackoverflow.com/questions/116446/what-is-the-best-back-button-jquery-plugin and more) and they all seem to deal with elements hiding/showing, like tabs on a page.

I started installing this history plugin (http://balupton.com/sandbox/jquery-history/demo/) but it seemed like I was going to hook into every form change and save the values myself. Or, they're trying to save the state off server-side and reload it when the back button is pressed.

Is there a way to just set a history savepoint? I'm really only worried about history; deep linking and bookmarking don't matter for this project.

If not, any generic way to handle the form? If I'm making this too hard, let me know. It sure seems like it should Just Work.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜