如何在提交电子邮件表单后关闭弹出页面 [英] how to close pop up page after email form has been submitted

查看:89
本文介绍了如何在提交电子邮件表单后关闭弹出页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在html页面上有一个表单,其中一个填写并使用电子邮件提交。


表格已在弹出页面中打开,


表格提交后,(通过电子邮件发送)我需要添加一些javasript来说谢谢你,在同一个窗口然后关闭它。或做其他事情,用户知道他的表格已经提交。弹出窗口显示谢谢可以有一个紧密的链接。我不需要刷新父页面或刷新任何内容,因为表单是电子邮件。


有什么建议可以添加到哪里?这是下面代码的相关部分。第一部分是弹出窗口的代码,用于打开它

I have a form on a html page which one fills in and submits using email.

The form has been opened in a pop up page,


Once the form has been submitted, (emailed) I need to add some javasript to say either "thank you," in the same window and then close it. Or do something else, that the user knows his form has been submitted. The pop up window that says "thank you" can have a close link on it. I do not need to refresh the parent page or refresh anything since the form is an email one.

Any suggestions what to add where? here is the relevant part of the code below. The first part is the code of the pop up window that is used to open it

展开 | 选择 | Wrap | 行号

推荐答案




让我告诉你如何做你想做的事。您可以为表单提供一个id,并在提交表单时创建一个额外的div以显示您想要显示的内容。现在将div的样式可见性设置为隐藏。在提交表单时,您切换两个容器的可见性样式(表单和div - >使表单可见性隐藏,并且div可见性可见)。


现在你可以添加一个带有window.close()动作的按钮或设置一个超时,在给定的时间后关闭你的窗口...


亲切的问候...


let me give you an idea on how to do what you want. you may give your form an id and create an additional div with what you want to have displayed when the form is submitted. now set the style visibility of the div to hidden. on submitting the form you toggle the visibility-style of your two containers (the form and the div -> make the form visibility hidden and the div visbility visible).

now you may add a button with window.close() action or set a timeout that closes you window after a given amout of time ...

kind regards ...


啊......让我提一下这个id是为了简单地使用getElementById ...你可以用来获取你的容器节点的引用;)


亲切的问候
ahh ... and let me mention that the id is for the simpe use of getElementById ... that you may use for getting a ref to your container-node ;)

kind regards


感谢所有回复的人。我可以说清楚我不是精明的人,也不懂所有这些HTML语言。


好​​吧我改了一下代码,但是表格仍然像以前一样,感谢信息没有显示。任何关于我做错什么的提示?谢谢。

Thank you to all who replied. Can i make it clear i''m not html savvy and don''t understand all this html lingo.

OK i changed the code a bit, but still the form is as before, the thank you message doesn''t show. Any tips anyone as to what im doing wrong? Thank you.

展开 | 选择 | Wrap | 行号


这篇关于如何在提交电子邮件表单后关闭弹出页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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