使用facebox提交表单
我有一个正在运行的 Rails 应用程序,我想为其添加一些 ajaxiness。
我目前有一个多步骤表单,想要执行以下操作:
- 用户在第 1 步单击“提交”(表单被提交)
- fancybox 启动显示注册表单,并且“注册”或“跳过”按钮
- 与“注册”无关或者在精美的框中单击“跳过”,用户将转到我的应用程序的步骤 2。
我正在搜索 launching fancybox on form Submit
和 submitting form via fancybox
在演示中我什么也没找到。
在我使用 fancybox 之前,有人使用 fancybox 插件完成了这个工作流程吗?
我阅读了一些SO问题,其中用户提交时遇到问题形式。对于我提到的工作流程有更好的插件吗?
I have a working app in rails that I want to sprinkle some ajaxiness to.
I currently have a Multistep form and want to do the following:
- user on step 1 clicks "submit" (form gets submitted)
- fancybox launches displaying signup form and "sign up" or "skip" buttons
- doesn't matter if "sign up" or "skip" was clicked on the fancy box, user moves to step 2 for my app.
I was searching for launching fancybox on form submit
and submitting form via fancybox
In the demo's I found nothing.
Before I go with fancybox, has someone done this workflow using the fancybox plugin?
I read some SO questions with users having issues submitting forms. Is there a better plugin for the workflow I mentioned?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我已经完成了与 fancybox 类似的实现。我有一个用户结帐,单击结帐后,会出现一个带有问题提示的精美框。在显示提示之前,它将提交表单。这是我使用的代码的概要:
我将表单提交按钮更改为链接:
将 fancybox 绑定到链接并添加 oncomplete 以便在 fancybox 打开后立即处理表单:
使用 javascript 函数使用 ajax 处理表单然后显示您的登录/创建帐户信息。如果是我,我会执行另一个 ajax 调用来显示您的登录/注册,但我已将这部分代码保留在外面,但用注释表示,您可以在其中调用它:
I have done an implementation similar with fancybox. I had a user checkout that upon clicking checkout, a fancybox would appear with a question prompt. Before showing the prompt it would submit the form. This is an outline of the code that I used:
I change the form submit button to a link:
Bind fancybox to the link and add an oncomplete to process the form as soon as fancybox opens:
Have a javascript function to process the form using ajax and then display your login/create account information. If it were me I would do another ajax call to display your login/signup but I have left that part of the code out but denoted with a comment where you can call it: