doubi4435 2019-06-11 13:18
浏览 201
已采纳

HTML表单操作不会重定向

I am very confused that my html form action doesn't redirect me to another page, because this has always worked.

Here's my code

 <section class="contact section-padding" data-scroll-index="6">
        <div class="container">
            <div class="row">

                <div class="section-head text-center col-sm-12">
                    <h4>Neem contact op</h4>
                    <h6>Vul formulier in</h6>
                </div>

                <div class="offset-lg-2 col-lg-8 offset-md-1 col-md-10">
                    <form method="post" class="form" id="contact-form" action="verstuurd.php">

                        <div class="messages"></div>

                        <div class="controls">

                            <div class="row">

                                <div class="col-md-6">
                                    <div class="form-group">
                                        <input id="form_name" type="text" name="volledige_naam" placeholder="Volledige naam">
                                    </div>
                                </div>
                                <div class="col-md-6">
                                    <div class="form-group">
                                        <input id="form_email" type="email" name="email" placeholder="E-mailadres" >
                                    </div>
                                </div>
                                <div class="col-md-12">
                                    <div class="form-group">
                                        <input id="form_subject" type="text" name="subject" placeholder="Onderwerp">
                                    </div>
                                </div>
                                <div class="col-md-12">
                                    <div class="form-group">
                                        <textarea id="form_message" name="message" placeholder="Bericht" rows="4" ></textarea>
                                    </div>
                                </div>

                                <div class="col-md-12 text-center">
                                    <button type="submit"><span>Verstuur</span></button>
                                </div>

                            </div>                             
                        </div>
                    </form>
                </div>

            </div>
        </div>
    </section>

What is wrong with this? I thought it might has to do something with the div classes, but is this possible?

Edit

Verstuurd.php

<section class="contact section-padding" data-scroll-index="6">
        <div class="container">
            <div class="row">

                <div class="section-head text-center col-sm-12">
                    <h4>Succesvol verstuurd</h4>
                    <h6>We nemen zo snel mogelijk contact met u op</h6>
                </div>


            </div>
        </div>
    </section>

At the moment I do not have any php code in verstuurd.php. I thought that aciton only redirects to PHP files and not HTML files.

  • 写回答

2条回答 默认 最新

  • doutan5798 2019-06-11 16:00
    关注

    I'm guessing there's some javascript that is blocking the form submission. Look out for anything similar to e.preventDefault(); in relation to form submission.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 sqlite 附加(attach database)加密数据库时,返回26是什么原因呢?
  • ¥88 找成都本地经验丰富懂小程序开发的技术大咖
  • ¥15 如何处理复杂数据表格的除法运算
  • ¥15 如何用stc8h1k08的片子做485数据透传的功能?(关键词-串口)
  • ¥15 有兄弟姐妹会用word插图功能制作类似citespace的图片吗?
  • ¥200 uniapp长期运行卡死问题解决
  • ¥15 latex怎么处理论文引理引用参考文献
  • ¥15 请教:如何用postman调用本地虚拟机区块链接上的合约?
  • ¥15 为什么使用javacv转封装rtsp为rtmp时出现如下问题:[h264 @ 000000004faf7500]no frame?
  • ¥15 乘性高斯噪声在深度学习网络中的应用