can't redirect form on submit

℡╲_俬逩灬. 提交于 2019-12-11 17:12:39

问题


Ok - I know I am being an idiot but I can not seem to get this form to redirect as I want it to:

    <form id="post" method="post" action="" name="post" onSubmit="window.location='http://www.website.com/overview'" >
        <input type="hidden" name="terms-and-conditions" value="true">
        <p class="submit">
            <input id="agree" type="submit" value="I Agree" name="agree"> 
            <input type="button" value="I Disagree" onClick="window.location='http://www.website.com'">
        </p>
    </form>

When the button type is "submit" it won't redirect in my PHP page. I have a feeling I am missing something obvious...

Thanks!


回答1:


just do

<form id="post" method="post" action="http://www.website.com/overview" name="post">


来源:https://stackoverflow.com/questions/3852850/cant-redirect-form-on-submit

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!