离线填写表格
这就是我正在尝试实现的,但我不知道如何去做:
我有一些用户应该能够离线完成的表单。用户填写表单后,他们应该能够点击“保存”,并且他们的数据需要离线保存。然后,当他们在线时,他们可以提交通过点击按钮保存的所有表单数据。他们将被要求登录,一旦登录,他们的数据将保存在服务器上。
这些表格将通过 iPad/iPhone 提交。用户可以保存每个表单的多个副本。
我正在寻找 HTML5/JavaScript/jQuery 解决方案。我的后端是php。我还没有尝试过任何事情,因为我不知道如何做到这一点。我从哪里开始?
谢谢
This is what I am trying to implement and I don't know how to do it:
I have a few forms that users should be able to complete offline. Once the user has filled in the form they should be able to hit save and their data needs to be saved offline. Then later when they are online they can submit all the form data which was saved by hitting a button. They will be asked to log in and once they have done so their data will be saved on server.
These forms will be submitted via iPad/iPhone. The user can save multiple copies of each form.
I am looking for an HTML5/JavaScript/jQuery solution. My backend is php. I have not tried anything yet as I don't have any idea how to do this. Where do I start?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以提供一个清单文件来向用户提供特定的表单 - 应用程序缓存 IIRC:
http://dev.w3.org/html5/spec/offline.html
警告 - 如果不使其成为本机应用程序,用户必须在线访问该网站才能看到任何表单
然后,一旦用户填写此内容,即可将结果存储在 localStorage 中,准备访问在线时。
如果用户在线,将显示标准页面,您可以检查本地存储中是否有任何未提交的表单,并在提交时从 localSorage 中删除。
查看本教程中使用的原则,它们应该可以帮助您完成大部分工作,但是您必须更多地研究离线 html 和 localStorage 才能获得一个可用的应用程序:
http://sixrevisions.com/web-development/html5-iphone-app/
希望有帮助。
You can provide a manifest file to provide a specific form to a user - Application cache IIRC:
http://dev.w3.org/html5/spec/offline.html
Caveat - without making it a native app the user would have to have visited the website while online before they will see any forms at all
Then once the user fills this in store the results in localStorage, ready to access when online.
If the user is online, the standard page will be displayed, and you can check local Storage for any unsubmitted forms, and on submission remove from localSorage.
Check out the principles used in this tutorial, they should get you most of the way there, but you'll have to look into offline html and localStorage a lot more to get a working app:
http://sixrevisions.com/web-development/html5-iphone-app/
Hope that helps.
我认为这不可能作为针对 iOS 的纯网络解决方案,因为您不能指望表单在 Safari 中保持不变。即使用户在有活动的互联网连接时提前在浏览器中加载表单,您也不能指望 Safari 不会尝试重新加载页面(这会清除页面并导致连接失败,因为它们处于离线状态) )。
因此,我认为您必须为此功能创建一个本机 iOS 应用程序。
如果您的目标是桌面,您可能可以使用浏览器插件来完成此任务。
I don't think this is possible as an web-only solution targeting iOS, since you can't count on the forms staying up in Safari. Even if the user loaded the form in their browser ahead of time when they had an active internet connection, you can't count on Safari not trying to reload the page (which would clear the page and give a connection failure since they're offline).
Therefore, I think you have to create a native iOS app for this functionality.
If you were targeting desktops instead, you could probably accomplish this with browser plugins.