title: Submit button not working in Wordpress
body: <p>This form works, but not in Wordpress. I am new to Wordpress so I am not sure what to do. I created 4 files:</p>
  
  <ul>
  <li>page where I created the form</li>
  <li>contact.php</li>
  <li>validator.js</li>
  <li>contact.js</li>
  </ul>
  
  <p>Here is the code for the form:</p>
  
  <pre><code>&lt;form class="form-horizontal" id="contact-form" method="post" action="contact.php" role="form"&gt;
                                  &lt;div class="messages"&gt;&lt;/div&gt;
  
                                  &lt;div class="controls"&gt;
  
                                      &lt;div class="col-lg-12"&gt;
                                          &lt;div class="form-group"&gt;
                                              &lt;input id="form_name" type="text" name="name" class="form-control" placeholder="Enter your full name*" required="required" data-error="Full name is required."&gt;
                                              &lt;div class="help-block with-errors"&gt;&lt;/div&gt;
                                          &lt;/div&gt;
                                      &lt;/div&gt;
  
                                      &lt;div class="col-lg-12"&gt;
                                          &lt;div class="form-group"&gt;
                                              &lt;input id="form_email" type="email" name="email" class="form-control" placeholder="Enter your email address*" required="required" data-error="Valid email is required."&gt;
                                              &lt;div class="help-block with-errors"&gt;&lt;/div&gt;
                                          &lt;/div&gt;
                                      &lt;/div&gt;
  
                                      &lt;div class="col-lg-12"&gt;
                                          &lt;div class="form-group"&gt;
                                              &lt;input id="form_phone" type="tel" name="phone" class="form-control" placeholder="Enter your phone number"&gt;
                                              &lt;input type="submit" class="btn modal-btn pull-right" value="send!" /&gt;
                                          &lt;/div&gt;
                                      &lt;/div&gt;
                                  &lt;/div&gt;
                              &lt;/form&gt;
  </code></pre>
  
  <p>Here is the code in contact.php:</p>
  
  <pre><code>&lt;?php
  // configure
  $from = 'codedstyles.com &lt;hello@codedstyles.com&gt;'; 
  $sendTo = 'Contact Form admin &lt;sanlorena@yahoo.com&gt;';
  $subject = 'Hi! You have a new message from a lead';
  $fields = array('name' =&gt; 'Name', 'phone' =&gt; 'Phone', 'email' =&gt; 'Email'); 
  // array variable name =&gt; Text to appear in email
  $okMessage = 'Thank you! We will get in touch with you shortly.';
  $errorMessage = 'There was an error while submitting the form. Please try again later';
  // Send code
  try
  {
  $emailText = "You have a message to respond\n=============================\n";
  
  foreach ($_POST as $key =&gt; $value) {
  
      if (isset($fields[$key])) {
          $emailText .= "$fields[$key]: $value\n";
     }
  }
  
  mail($sendTo, $subject, $emailText, "From: " . $from);
  
  $responseArray = array('type' =&gt; 'success', 'message' =&gt; $okMessage);
  }
  catch (\Exception $e)
  {
  $responseArray = array('type' =&gt; 'danger', 'message' =&gt; $errorMessage);
  }
  
  if (!empty($_SERVER['HTTP_X_REQUESTED_WITH']) &amp;&amp; strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') {
  $encoded = json_encode($responseArray);
  
  header('Content-Type: application/json');
  
  echo $encoded;
  }
  else {
      echo $responseArray['message'];
  }
  </code></pre>