title: formValidation.io withbootstrap prevent to submit the form
body: <p>I checked all posts/answer but unable to find the answer. Validation works perfectly but it prevents to submit the form. But if i remove validation then values of form goes to email. What i found in common is button name/id shouldn't be "Submit". Form name shouldn't be duplicate. But still this form doesn't work</p>
  
  <p>Here is the code</p>
  
  <pre><code>&lt;!---Included files ---&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="dist/js/formValidation.min.js"&gt;&lt;/script&gt;
  &lt;script src="dist/js/frame/work/bootstrap.min.js"&gt;&lt;/script&gt;
  
  
  &lt;script type="text/javascript"&gt;
  $(document).ready(function() {
      // Generate a simple captcha
      function randomNumber(min, max) {
          return Math.floor(Math.random() * (max - min + 1) + min);
      };
      $('#captchaOperation').html([randomNumber(1, 100), '+', randomNumber(1, 200), '='].join(' '));    
      $('#defaultForm').formValidation({
          message: 'This value is not valid',
          icon: {
              valid: 'glyphicon glyphicon-ok',
              invalid: 'glyphicon glyphicon-remove',
              validating: 'glyphicon glyphicon-refresh'
          },
          fields: {
              name: {
                  validators: {
                      notEmpty: {
                          message: 'The name is required'
                      }
                  }
              },
              subject: {
                  validators: {
                      notEmpty: {
                          message: 'The subject is required'
                      }
                  }
              },
              message: {
                  message: 'The message is not valid',
                  validators: {
                      notEmpty: {
                          message: 'The message is required'
                      },
                      stringLength: {
                          min: 6,
                          max: 30,
                          message: 'The message must be more than 6 and less than 30 characters long'
                      },
                   }
              },
              email: {
                  validators: {
                      notEmpty: {
                          message: 'The email address is required'
                      },
                      emailAddress: {
                          message: 'The input is not a valid email address'
                      }
                  }
              },
              captcha: {
                  validators: {
                      callback: {
                          message: 'Wrong answer',
                          callback: function(value, validator, $field) {
                              var items = $('#captchaOperation').html().split(' '), sum = parseInt(items[0]) + parseInt(items[2]);
                              return value == sum;
                          }
                      }
                  }
              }   
  
          }
      }).on('success.form.fv', function(e) {
          // Prevent submit form
          e.preventDefault();
  
          var $form     = $(e.target),
              validator = $form.data('formValidation');
          $form.find('.alert').html('Thanks' + validator.getFieldElements('name').val()).show();
      });
  });
  &lt;/script&gt;
  
  &lt;!--- --------------------------Form Start-------------&gt;
  &lt;form class="form-horizontal" method="post" action="&lt;?php echo $PHP_SELF;?&gt;" id="defaultForm"&gt;
  
      &lt;fieldset&gt;
  
          &lt;!-- Text input--&gt;
          &lt;div class="form-group"&gt;
            &lt;label class="col-md-4 control-label" for="name"&gt;Name*&lt;/label&gt;  
            &lt;div class="col-md-4"&gt;
            &lt;input id="name" name="name" type="text" placeholder="Name" class="form-control input-md" required=""&gt;
  
            &lt;/div&gt;
          &lt;/div&gt;
  
          &lt;!-- Text input--&gt;
          &lt;div class="form-group"&gt;
            &lt;label class="col-md-4 control-label" for="email"&gt;Email*&lt;/label&gt;  
            &lt;div class="col-md-4"&gt;
            &lt;input id="email" name="email" type="text" placeholder="xyz@abc.com" class="form-control input-md" required=""&gt;
  
            &lt;/div&gt;
          &lt;/div&gt;
  
          &lt;!-- Text input--&gt;
          &lt;div class="form-group"&gt;
            &lt;label class="col-md-4 control-label" for="subject"&gt;Subject*&lt;/label&gt;  
            &lt;div class="col-md-4"&gt;
            &lt;input id="subject" name="subject" type="text" placeholder="" class="form-control input-md" required=""&gt;
  
            &lt;/div&gt;
          &lt;/div&gt;
  
          &lt;!-- Multiple Radios --&gt;
          &lt;div class="form-group"&gt;
            &lt;label class="col-md-4 control-label" for="receiver"&gt;Please select the person you would like to receive this email:&lt;/label&gt;
            &lt;div class="col-md-4"&gt;
            &lt;div class="radio"&gt;
              &lt;label for="receiver-0"&gt;
                &lt;input type="radio" name="receiver" id="receiver-0" value="Dr. Bill Stackhouse" checked="checked"&gt;
                Dr. Bill Stackhouse
              &lt;/label&gt;
              &lt;/div&gt;
            &lt;div class="radio"&gt;
              &lt;label for="receiver-1"&gt;
                &lt;input type="radio" name="receiver" id="receiver-1" value="Dr. Larry Laughlin"&gt;
                Dr. Larry Laughlin
              &lt;/label&gt;
              &lt;/div&gt;
            &lt;div class="radio"&gt;
              &lt;label for="receiver-2"&gt;
                &lt;input type="radio" name="receiver" id="receiver-2" value="Dr. Ryan Laughlin"&gt;
                Dr. Ryan Laughlin
              &lt;/label&gt;
              &lt;/div&gt;
            &lt;div class="radio"&gt;
              &lt;label for="receiver-3"&gt;
                &lt;input type="radio" name="receiver" id="receiver-3" value="Frank Chen"&gt;
                Frank Chen
              &lt;/label&gt;
              &lt;/div&gt;
            &lt;div class="radio"&gt;
              &lt;label for="receiver-4"&gt;
                &lt;input type="radio" name="receiver" id="receiver-4" value="Suzanne Fancy"&gt;
                Suzanne Fancy
              &lt;/label&gt;
              &lt;/div&gt;
            &lt;div class="radio"&gt;
              &lt;label for="receiver-5"&gt;
                &lt;input type="radio" name="receiver" id="receiver-5" value="Sandy Fernandes"&gt;
                Sandy Fernandes
              &lt;/label&gt;
              &lt;/div&gt;
            &lt;div class="radio"&gt;
              &lt;label for="receiver-6"&gt;
                &lt;input type="radio" name="receiver" id="receiver-6" value="Helena Greyvenstein"&gt;
                Helena Greyvenstein
              &lt;/label&gt;
              &lt;/div&gt;
            &lt;div class="radio"&gt;
              &lt;label for="receiver-7"&gt;
                &lt;input type="radio" name="receiver" id="receiver-7" value="Traci Howard"&gt;
                Traci Howard
              &lt;/label&gt;
              &lt;/div&gt;
            &lt;div class="radio"&gt;
              &lt;label for="receiver-8"&gt;
                &lt;input type="radio" name="receiver" id="receiver-8" value="Leslie Martin"&gt;
                Leslie Martin
              &lt;/label&gt;
              &lt;/div&gt;
            &lt;div class="radio"&gt;
              &lt;label for="receiver-9"&gt;
                &lt;input type="radio" name="receiver" id="receiver-9" value="Leydia Nayfeh"&gt;
                Leydia Nayfeh
              &lt;/label&gt;
              &lt;/div&gt;
            &lt;/div&gt;
          &lt;/div&gt;
  
          &lt;!-- Multiple Checkboxes --&gt;
          &lt;div class="form-group"&gt;
            &lt;label class="col-md-4 control-label" for="copytoyourself"&gt;Send a copy of this message to yourself:&lt;/label&gt;
            &lt;div class="col-md-4"&gt;
            &lt;div class="checkbox"&gt;
              &lt;label for="copytoyourself-0"&gt;
                &lt;input type="checkbox" name="copytoyourself" id="copytoyourself-0" value="Yes"&gt;
                Yes
              &lt;/label&gt;
              &lt;/div&gt;
            &lt;/div&gt;
          &lt;/div&gt;
  
          &lt;!-- Textarea --&gt;
          &lt;div class="form-group"&gt;
            &lt;label class="col-md-4 control-label" for="message"&gt;Message&lt;/label&gt;
            &lt;div class="col-md-4"&gt;                     
              &lt;textarea class="form-control" id="message" name="message"&gt;&lt;/textarea&gt;
            &lt;/div&gt;
          &lt;/div&gt;
  
          &lt;!-- Text input--&gt;
          &lt;div class="form-group"&gt;
            &lt;label class="col-md-4 control-label" for="phone"&gt;Contact Number:&lt;/label&gt;  
            &lt;div class="col-md-4"&gt;
            &lt;input id="phone" name="phone" type="number" placeholder="" class="form-control input-md" required=""&gt;
  
            &lt;/div&gt;
          &lt;/div&gt;
  
          &lt;!-- Multiple Checkboxes --&gt;
          &lt;div class="form-group"&gt;
            &lt;label class="col-md-4 control-label" for="time"&gt;When is the best time to contact you:&lt;/label&gt;
            &lt;div class="col-md-4"&gt;
            &lt;div class="checkbox"&gt;
              &lt;label for="time-0"&gt;
                &lt;input type="checkbox" name="time" id="time-0" value="Morning (before 9am)"&gt;
                Morning (before 9am)
              &lt;/label&gt;
              &lt;/div&gt;
            &lt;div class="checkbox"&gt;
              &lt;label for="time-1"&gt;
                &lt;input type="checkbox" name="time" id="time-1" value="Day (9am to 5pm)"&gt;
                Day (9am to 5pm)
              &lt;/label&gt;
              &lt;/div&gt;
            &lt;div class="checkbox"&gt;
              &lt;label for="time-2"&gt;
                &lt;input type="checkbox" name="time" id="time-2" value="Evening (after 5pm)"&gt;
                Evening (after 5pm)
              &lt;/label&gt;
              &lt;/div&gt;
            &lt;/div&gt;
          &lt;/div&gt;
          &lt;div class="form-group"&gt;
           &lt;label class="col-md-4 control-label" id="captchaOperation"&gt;&lt;/label&gt;
            &lt;div class="col-md-4"&gt;
              &lt;input type="text" class="form-control" name="captcha" /&gt;
             &lt;/div&gt;
           &lt;/div&gt;
          &lt;!-- Button --&gt;
          &lt;div class="form-group"&gt;
            &lt;label class="col-md-4 control-label" for="submit"&gt;&lt;/label&gt;
            &lt;div class="col-md-4"&gt;
              &lt;button id="submitButton" name="submitButton" class="btn btn-default"&gt;Message us&lt;/button&gt;
            &lt;/div&gt;
          &lt;/div&gt;
          &lt;div class="alert alert-success" style="display: none; text-align:center;"&gt;&lt;/div&gt;
      &lt;/fieldset&gt;
  &lt;/form&gt;
  &lt;!---------------php start ----------------------&gt;
  &lt;?php
      include_once("Mail.php");
      if (isset($_POST["submitButton"])) {
          $email ='';
          $subject ='';
          $message ='';
          $phone ='';
          $from =''; 
          $to ='';
          $receiver ='';
          $time ='';
          $errName ='';
          $errEmail='';
          $errMessage='';
          $copytoyourself ='';
          echo $name = $_POST['name'];
          $email = $_POST['email'];
          $subject = $_POST['subject'];
          $message = $_POST['message'];
          $phone = $_POST['phone'];
          $from = ''.$email; 
          $to = 'info@innovationskies.com'; 
          $receiver = $_POST['receiver'];         
  
          $message1 = "Doctor Name: $receiver\n Time to Contact: $time ";
          echo    $body = "From: $name\n E-Mail: $email\n Phone: $phone\n Message:\n $message\n $message1";
  
  
          // If there are no errors, send the email
          if (!$errName &amp;&amp; !$errEmail &amp;&amp; !$errMessage) {
              if (mail ($to, $subject, $body,  "From: &lt;$email&gt;")) {
                   $result='&lt;div class="alert alert-success"&gt;Thank You! I will be in touch&lt;/div&gt;';
                   // If there if copytoyourself is yes 
                  if (isset($_POST["copytoyourself"])) {  
                  mail ($email, "Copy: &lt;$subject&gt;", $body,  "From: &lt;$email&gt;");
                  }
              }
              else {
                  $result='&lt;div class="alert alert-danger"&gt;Sorry there was an error sending your message. Please try again later&lt;/div&gt;';
              }
          }
      }
  ?&gt;
  </code></pre>