简体   繁体   English

单击提交后如何重定向到同一“联系我们”页面

[英]how to redirect to the same contact us page after clicking submit

I am using single template that is index.html . 我使用的是index.html单个模板。 In contact us section after submitting the form " Thank You, Your message has been sent successfully " should be shown in the same page and place without reloading to another page. 提交表格“ 谢谢您,您的消息已成功发送 ”后,请与我们联系。该页面应显示在同一页面和位置,而无需重新加载到另一页面。 We are using mail-contact.php code as form action="mail-contact.php" data-ajax="false" method="post" class="form" in index page. 我们正在使用mail-contact.php代码作为索引页中的表单action="mail-contact.php" data-ajax="false" method="post" class="form"

mail-contact.php contains the entire index page code and with some added validation code in contact form, thank you message. mail-contact.php包含整个索引页面代码,并在联系表中添加了一些验证代码,谢谢。 So when I click on submit button in contact form it is redirecting to mail-contact.php and showing the starting of the page. 因此,当我单击联系表单中的“提交”按钮时,它将重定向到mail-contact.php并显示页面的开始。 But I need after clicking submit button it should show thank you message in index page itself. 但是我需要单击提交按钮后,它应该在索引页面本身中显示感谢消息。

我认为最好的解决方案是使用“ flashbag”消息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM