Jquery validator and php mail form not working
<p>Hi I'm trying to use the Boostrap Validator plugin for a simple php mail form but for some reason every time i fill it out correctly and hit send. I am uploading it to my web hosting and it all should check out. Right now they both work independently of eachother but when I add the validator to the php form it just validates it but prevents it from sending? I'm not very good with php or jquery so can so someone please tell me what im doing wrong?</p>

<p>this is my php document</p>

<pre><code>&lt;?php
    if (isset($_POST["submit"])) {
        $name = $_POST['name'];
        $email = $_POST['email'];
        $message = $_POST['message'];
        $from = 'Demo Contact Form'; 
        $to = 'porterlou97@gmail.com'; 
        $subject = 'Message from Contact Demo ';

        $body ="From: $name\n E-Mail: $email\n Message:\n $message";
        // Check if name has been entered
        if (!$_POST['name']) {
            $errName = 'Please enter your name';
        }

        // Check if email has been entered and is valid
        if (!$_POST['email'] || !filter_var($_POST['email'], FILTER_VALIDATE_EMAIL)) {
            $errEmail = 'Please enter a valid email address';
        }

        //Check if message has been entered
        if (!$_POST['message']) {
            $errMessage = 'Please enter your message';
        }

// If there are no errors, send the email
if (!$errName &amp;&amp; !$errEmail &amp;&amp; !$errMessage) {
    if (mail ($to, $subject, $body, $from)) {
        $result='&lt;div class="modal fade bs-example-modal-sm" id="feedback-result" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel"&gt;&lt;div class="modal-dialog modal-sm"&gt;&lt;div class="modal-content"&gt;&lt;div class="alert alert-success text-center" style="margin-bottom:0;"&gt;&lt;h4&gt;Thank You! I will be in touch&lt;/h4&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;';
    } else {
        $result='&lt;div class="modal fade bs-example-modal-sm" id="feedback-result" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel"&gt;&lt;div class="modal-dialog modal-sm"&gt;&lt;div class="modal-content"&gt;&lt;div class="alert alert-danger text-center" style="margin-bottom:0;"&gt;&lt;h4&gt;Sorry there was an error sending your message. Please try again later.&lt;/h4&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;';
    }
}
    }
?&gt;
&lt;!DOCTYPE html&gt;
&lt;html lang="en"&gt;
&lt;head&gt;
&lt;meta charset="utf-8"&gt;
&lt;meta http-equiv="X-UA-Compatible" content="IE=edge"&gt;
&lt;meta name="viewport" content="width=device-width, initial-scale=1"&gt;
&lt;title&gt;Indiana Porter&lt;/title&gt;
&lt;link href="css/bootstrap.css" rel="stylesheet"&gt;
&lt;link href="css/lightbox.css" rel="stylesheet"&gt;
&lt;link rel="stylesheet" href="css/bootstrapValidator.css"/&gt;
&lt;script type="text/javascript" src="js/jquery.min.js"&gt;&lt;/script&gt;
&lt;script type="text/javascript" src="js/bootstrap.min.js"&gt;&lt;/script&gt;
&lt;script type="text/javascript" src="js/bootstrapValidator.js"&gt;&lt;/script&gt;
&lt;/head&gt;
&lt;body data-spy="scroll" data-target="#posts"&gt;
&lt;style&gt;figure{padding:10px 15px;}&lt;/style&gt;
&lt;?php echo $result; ?&gt;
&lt;div class="modal fade" id="feedback" tabindex="-1" role="dialog" aria-labelledby="feedbackLabel"&gt;
    &lt;div class="modal-dialog" role="document"&gt;
        &lt;div class="modal-content"&gt;

                &lt;div class="row"&gt;&lt;div class="col-md-10 col-md-offset-1"&gt;
          &lt;div class="modal-header"&gt;
            &lt;h3 class="modal-title" id="feedbackLabel"&gt;Email me&lt;/h3&gt;
            &lt;/div&gt;
            &lt;form class="form" id="feedbackForm" role="form" method="post" action="index.php"&gt;
                &lt;div class="modal-body"&gt;

            &lt;div class="row"&gt;
                &lt;div class="col-md-6"&gt;
                &lt;div class="form-group"&gt;
                        &lt;input type="text" class="form-control" name="name" placeholder="Name" value="&lt;?php echo htmlspecialchars($_POST['name']); ?&gt;"&gt;
                    &lt;/div&gt;
                    &lt;/div&gt;
                &lt;div class="col-md-6"&gt;
                    &lt;div class="form-group"&gt;
                        &lt;input type="text" class="form-control" name="email" placeholder="Email" value="&lt;?php echo htmlspecialchars($_POST['email']); ?&gt;"&gt;
                    &lt;/div&gt;
                &lt;/div&gt;
                &lt;/div&gt;
                &lt;div class="form-group"&gt;
                        &lt;textarea class="form-control" name="message" placeholder="Message" rows="5"&gt;&lt;?php echo htmlspecialchars($_POST['message']);?&gt;&lt;/textarea&gt;
                &lt;/div&gt;
                &lt;/div&gt;
                &lt;div class="modal-footer"&gt;
                &lt;div class="form-group"&gt;
                    &lt;div class="col-lg-9 col-lg-offset-3"&gt;
            &lt;input id="submit" name="submit" type="submit" value="Send" class="btn btn-primary"&gt;
                    &lt;/div&gt;
                &lt;/div&gt;
                    &lt;div class="form-group"&gt;
        &lt;div class="col-sm-10 col-sm-offset-2"&gt;
            &lt;?php echo $result; ?&gt;  
        &lt;/div&gt;
    &lt;/div&gt;
                &lt;/div&gt;
            &lt;/form&gt;
            &lt;/div&gt;

                &lt;/div&gt;
                &lt;/div&gt;
        &lt;/div&gt;
    &lt;/div&gt;
&lt;div class="container"&gt;
                &lt;div class="row"&gt;
        &lt;div class="col-sm-3"&gt;
            &lt;div id="sidebar"&gt;
                &lt;div class="row"&gt;
                    &lt;div class="about text-center page-header"&gt;
                        &lt;img src="images/me.jpg" class="img-circle" width="100px"&gt;
                        &lt;h3&gt;Indiana Porter&lt;/h3&gt;
                        &lt;small&gt;art blog and other nonsense&lt;/small&gt;
                    &lt;/div&gt;
                    &lt;div class="posts page-header text-center"&gt;
                        &lt;h4&gt;
                            &lt;strong&gt;Posts&lt;/strong&gt;
                        &lt;/h4&gt;
                        &lt;div id="posts"&gt;
                            &lt;ul class="nav nav-tabs nav-stacked"&gt;
                                &lt;li class="active"&gt;
                                    &lt;a href="#010429161" class="page-scroll"&gt;Back to the future!&lt;/a&gt;
                                &lt;/li&gt;
                                &lt;li&gt;
                                    &lt;a href="#310320162" class="page-scroll"&gt;How about something... spacey&lt;/a&gt;
                                &lt;/li&gt;
                            &lt;/ul&gt;
                        &lt;/div&gt;
                        &lt;br&gt;
                    &lt;/div&gt;
                    &lt;div class="col-md-12 text-center"&gt;
                        &lt;button type="button" class="btn btn-default" data-toggle="modal" data-target="#feedback"&gt;Email me&lt;/button&gt;
                    &lt;/div&gt;
                &lt;/div&gt;
            &lt;/div&gt;
        &lt;/div&gt;
        &lt;div class="col-sm-9"&gt;  
    &lt;/div&gt;
    &lt;h4 class="text-center"&gt;
        &lt;small&gt;Copyright 
            &lt;span class="glyphicon glyphicon-copyright-mark" aria-hidden="true"&gt;&lt;/span&gt;
            Indiana Porter 2016
        &lt;/small&gt;
    &lt;/h4&gt;
&lt;/div&gt;
&lt;script src="js/jquery.min.js"&gt;&lt;/script&gt;
&lt;script src="js/bootstrap.min.js"&gt;&lt;/script&gt;
&lt;script src="js/lightbox.js"&gt;&lt;/script&gt;
&lt;script src="js/bootstrapValidator.js"&gt;&lt;/script&gt;
&lt;script src="js/jquery.easing.min.js"&gt;&lt;/script&gt;
&lt;script src="js/scrolling-nav.js"&gt;&lt;/script&gt;
&lt;script&gt;
function positionSidebar() {
    if ($('.container').first().outerWidth() &gt; 766) {
        $('#sidebar').affix({});
    } else {
        $('#sidebar').removeClass('affix');
    }
}

setInterval(positionSidebar, 300);
&lt;/script&gt;
&lt;script&gt;
    $(function() {
    var $sidebar = $('#sidebar');
        resize = function() { $sidebar.width($sidebar.parent().width()); };
    $(window).resize(resize); 
   resize();
});
&lt;/script&gt;
&lt;script type="text/javascript"&gt;
    $(document).ready(function () {
        $('#feedback-result').modal('show');
    });
&lt;/script&gt;
&lt;script type="text/javascript"&gt;
$(document).ready(function() {
    $('#feedbackForm')
        .bootstrapValidator({
            message: 'This value is not valid',
            feedbackIcons: {
                valid: 'glyphicon glyphicon-ok',
                invalid: 'glyphicon glyphicon-remove',
                validating: 'glyphicon glyphicon-refresh'
            },
            fields: {
                'name': {
                    validators: {
                        notEmpty: {
                            message: 'This is required and cannot be empty'
                        }
                    }
                },
                'message': {
                    validators: {
                        notEmpty: {
                            message: 'This is required and cannot be empty'
                        }
                    }
                },
                'email': {
                    validators: {
                        notEmpty: {
                            message: 'This is required and cannot be empty'
                        },
                        emailAddress: {
                            message: 'This not a valid email address'
                        }
                    }
                }
            }
        });
});
&lt;/script&gt;
&lt;/body&gt;
&lt;/html&gt;
</code></pre>