检查网页表单值是否已更改 [英] Check if web form values have changed
问题描述
我有一个多步表单,用户可以导航到任何页面来修改或添加信息。有一个菜单显示当前的进度,用户已完成的步骤,并允许导航到任何已完成或未决的步骤。
尽管有一个大按钮保存并继续,一些用户点击此菜单进一步浏览。我必须检查 - 如果表格中的值已更改并询问:保存更改?是/否。
建议我检查表单值是否已更改,最好的方法是什么(使用最少的客户端JavaScript代码)?
稍后编辑:
我忘记说多步骤表单在步骤之间使用回发。
jQueryDirty Form插件可能会帮助您在这里:
http://plugins.jquery.com/project/dirtyform
I have a multi-step form and user can navigate to any page to modify or add information. There is a menu that shows the current progress, the steps the user has completed, and allows to navigate to any completed or pending step.
In spite of a big button "Save and Continue" some users click this menu to navigate further. I have to check - if values have changed in a form and ask: "Save changes? Yes/No".
What is the best way (with minimum client-side JavaScript code) you suggest me to check if form values have changed?
Edited a bit later:
I forgot to tell that the multi-step form uses postback between steps.
The jQuery "Dirty Form" plugin may help you out here:
http://plugins.jquery.com/project/dirtyform
这篇关于检查网页表单值是否已更改的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!