如何使用多个选择下拉列表保存html表单的选择历史记录 [英] How to save the select history of a html form with multiple select drop down lists

查看:220
本文介绍了如何使用多个选择下拉列表保存html表单的选择历史记录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经创建了一个带有多种形式的wizzard。向导的用户可以使用导航按钮遍历表单。
其中一个表单包含多个下拉列表,其中列表中的选项取决于先前的选择。使用Web服务查询创建每个选项列表。
用户可以随时更改以前的选择。

I have created a wizzard with multiple forms. A user of the wizard can traverse through the forms back and forward using navigation buttons. One of the forms contains multiple drop down lists, where the options in a list depends on the previous selection. Every option list is created using a webservice query. A user can always change a previous selection.

当用户完成所有选择后,提交表单,用户输入下一个表单。
我的问题:如何保存选择选项历史。我们需要这个历史记录,包括下拉列表中的所有选项,如果用户决定回到此表单修改他的选择。

When all selections have been completed by the user, the form is submitted and the user enters the next form. My question: how to save the select options history. We need this history including all the options in the drop down lists, if the user decides to go back to this form to modify his selections.

我自己的解决方案:保存表单(dom)实例(在cookie中)?有没有一个很好的选择?

My own solution: saving the form (dom) instance ( in a cookie?). Is there a good alternative?

推荐答案

您可以从该Web服务加载选项,同时设置jQuery的缓存属性ajax方法为true。这意味着将从浏览器缓存提供进一步的呼叫。请检查此链接以获取更多信息: http://jqapi.com/#p=jQuery.ajax

You can load the options from that Web Service of yours while settings the cache property of the jQuery ajax method to true. This means further calls will be served from the browser cache. Please checkout this link for further info: http://jqapi.com/#p=jQuery.ajax

但是,您可以随时使用clientStorage,sessionStorage,globalStorage等在客户端上缓存这些数据。 (有关详情,请访问: https://developer.mozilla.org/en/DOM/Storage

However, you can always cache those data using the localStorage, sessionStorage, globalStorage and the like on the client side. (Fore more info, please visit: https://developer.mozilla.org/en/DOM/Storage)

这篇关于如何使用多个选择下拉列表保存html表单的选择历史记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆