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 救!ENVI5.6深度学习初始化模型报错怎么办?
  • ¥30 eclipse开启服务后,网页无法打开
  • ¥30 雷达辐射源信号参考模型
  • ¥15 html+css+js如何实现这样子的效果?
  • ¥15 STM32单片机自主设计
  • ¥15 如何在node.js中或者java中给wav格式的音频编码成sil格式呢
  • ¥15 不小心不正规的开发公司导致不给我们y码,
  • ¥15 我的代码无法在vc++中运行呀,错误很多
  • ¥50 求一个win系统下运行的可自动抓取arm64架构deb安装包和其依赖包的软件。
  • ¥60 fail to initialize keyboard hotkeys through kernel.0000000000