admin管理员组文章数量:1324848
I am using Simple Form (getsimpleform) to email the HTML form contents to my email. The problem I am facing is that the HTML Form action is handled by getsimpleform so when the user clicks on submit button of the form, they are redirected to /
but I want them to stay be redirected to another page (i.e. contact.html).
So I want the form action to be performed but at the same time, I want the user to be redirected to another web page.
Thanks.
I am using Simple Form (getsimpleform.) to email the HTML form contents to my email. The problem I am facing is that the HTML Form action is handled by getsimpleform so when the user clicks on submit button of the form, they are redirected to https://getsimpleform./
but I want them to stay be redirected to another page (i.e. contact.html).
So I want the form action to be performed but at the same time, I want the user to be redirected to another web page.
Thanks.
Share Improve this question edited Jun 6, 2017 at 9:28 Nirav Madariya 1,5082 gold badges24 silver badges38 bronze badges asked Jun 6, 2017 at 8:01 Masoom GilaniMasoom Gilani 692 gold badges2 silver badges10 bronze badges 3- change form's action attribute to your own's url – ZiTAL Commented Jun 6, 2017 at 8:05
- 1 please show us your code – Gonras Karols Commented Jun 6, 2017 at 8:07
-
use ajax to send form data and change
action="yourdomain./contact.html"
– Nirav Madariya Commented Jun 6, 2017 at 8:16
4 Answers
Reset to default 2Just fill up your action attribute
<form action="next-page-please-url">
<button>butt</button>
</form>
You can add an action calback on your button, for example :
in yout HTML
<form>
...
<input type="submit" onclick="redirect()">
</form>
and in your javascript :
var redirect = function(){
document.location.href="contact.html"
}
First of all you need to change the action url of the form to your domain name
From
action="https://getsimpleform./"
To
action="https://YourDomain./"
and then on your php or whatever server side language you are using you can redirect e.g. I will use php example.
header('Location: http://www.YourDomain./OtherPage');
Based on their official page remendation on redirect
<input type='hidden' name='redirect_to' value='https://yourdomain./contact.html' />
Try to insert it into the form and see whether it solves your problem.
P.S. don't forget to change [yourdomain] to your actual domain.
本文标签: javascriptHow to redirect to another page after form actionStack Overflow
版权声明:本文标题:javascript - How to redirect to another page after form action? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742153645a2423657.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论