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 乌班图ip地址配置及远程SSH
  • ¥15 怎么让点阵屏显示静态爱心,用keiluVision5写出让点阵屏显示静态爱心的代码,越快越好
  • ¥15 PSPICE制作一个加法器
  • ¥15 javaweb项目无法正常跳转
  • ¥15 VMBox虚拟机无法访问
  • ¥15 skd显示找不到头文件
  • ¥15 机器视觉中图片中长度与真实长度的关系
  • ¥15 fastreport table 怎么只让每页的最下面和最顶部有横线
  • ¥15 java 的protected权限 ,问题在注释里
  • ¥15 这个是哪里有问题啊?