简体   繁体   中英

HTML form action doesn't redirect

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.

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.

Change your button from

 <button type="submit"><span>Verstuur</span></button>

to

<input id="submit" name="submit" type="submit" value="Verstuur">

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM