title: Contact form not working after migration from HTML (static) to WP
body: <p>Thanks in advance for reading. 
  I converted my static HTML page to Wordpress, after the contact-form stopped working. I think it has something to do with the linking in the form.js and handler.php. See ** in handler.php and form.js. Help me out !!! :)</p>
  
  <p>Live version: 050management.nl</p>
  
  <p>Form HTML<br>
      
                        </p>
  
  <pre><code>                        &lt;div class="row"&gt;
                              &lt;div class="col-md-7"&gt;
                                  &lt;div class="input-group"&gt;
                                      &lt;input type="text" class="form-control" type="text" name="Name" id="name" placeholder="Uw naam..." required data-error="Voer uw naam in"&gt;
  
                                  &lt;/div&gt;
                              &lt;/div&gt;
                          &lt;/div&gt;
  
  
                        &lt;div class="row"&gt;
                              &lt;div class="col-md-7 pt-2"&gt;
                                  &lt;div class="input-group"&gt;
                                      &lt;input type="text" class="form-control" type="email" name="Email" id="email" placeholder="Uw e-mailadres..." required data-error="Voer uw e-mailadres in"&gt;
  
                                  &lt;/div&gt;
                              &lt;/div&gt;
                          &lt;/div&gt;
  
                          &lt;div class="row"&gt;
                              &lt;div class="col-md-12 pt-2"&gt;
                                  &lt;div class="input-group"&gt;
                                      &lt;textarea name="Message" id="message" class="form-control" cols="30" rows="5" placeholder="Uw bericht..." data-error="Stel uw vraag"&gt;&lt;/textarea&gt;
  
                                  &lt;/div&gt;
                              &lt;/div&gt;
                          &lt;/div&gt;
                          &lt;div class="input-group pt-2"&gt;
                          &lt;div class="g-recaptcha" data-sitekey="6LddA2oUAAAAAHmFtwEkS68c4_UUi3hGpd7AZyOo"&gt;&lt;/div&gt;
  
                          &lt;/div&gt;
                          &lt;div class="row"&gt;
                              &lt;div class="col-md-9 pt-2"&gt;
                                  &lt;div class="input-group"&gt;
                                      &lt;input type="submit" class="contact-submit" value="Verzenden"&gt;
                                  &lt;/div&gt;
                              &lt;/div&gt;
                         &lt;/div&gt;
  
                   &lt;/form&gt;
   &lt;div  id="success_message" style="display:none"&gt;
    &lt;h4&gt;Dank voor uw bericht.&lt;/h4&gt;
    &lt;p&gt;
    We zullen spoedig contact met u opnemen.
    &lt;/p&gt;
    &lt;/div&gt;
   &lt;div id="error_message"
      style="width:100%; height:100%; display:none; "&gt;
          &lt;h4&gt;Er ging iets mis...&lt;/h4&gt;
          &lt;p&gt;&lt;a href="mailto:info@050management.nl"&gt;Mail &lt;/a&gt;ons of &lt;a href="tel:0031502115149"&gt;bel &lt;/a&gt;ons rechtsreeks. Dank u wel. 
   &lt;/div&gt;
   &lt;/div&gt;
  </code></pre>
  
  <p>.........</p>
  
  <pre><code>&lt;script src="&lt;?php echo get_template_directory_uri().'/js/form.js' ?&gt;"&gt;&lt;/script&gt;
  </code></pre>
  
  <p>form.js (url: /js/form.js)</p>
  
  <pre><code> $(function()
   {
  function after_form_submitted(data) 
  {
      if(data.result == 'success')
      {
          $('form#reused_form').hide();
          $('#success_message').show();
          $('#error_message').hide();
      }
      else
      {
          $('#error_message').append('&lt;ul&gt;&lt;/ul&gt;');
  
          jQuery.each(data.errors,function(key,val)
          {
              $('#error_message ul').append('&lt;li&gt;'+key+':'+val+'&lt;/li&gt;');
          });
          $('#success_message').hide();
          $('#error_message').show();
  
          //reverse the response on the button
          $('button[type="button"]', $form).each(function()
          {
              $btn = $(this);
              label = $btn.prop('orig_label');
              if(label)
              {
                  $btn.prop('type','submit' ); 
                  $btn.text(label);
                  $btn.prop('orig_label','');
              }
          });
  
      }//else
  }
  
  $('#reused_form').submit(function(e)
    {
      e.preventDefault();
  
      $form = $(this);
      //show some response on the button
      $('button[type="submit"]', $form).each(function()
      {
          $btn = $(this);
          $btn.prop('type','button' ); 
          $btn.prop('orig_label',$btn.text());
          $btn.text('Sending ...');
      });
  
  
                  $.ajax({
              type: "POST",
              **url: 'handler.php',**
              data: $form.serialize(),
              success: after_form_submitted,
              dataType: 'json' 
          });        
  
    });   
   });
  </code></pre>
  
  <p>handler.php (url: handler.php) same folder as index.php</p>
  
  <pre><code> &lt;?php
   ini_set('display_errors', 1);
   ini_set('display_startup_errors', 1);
   error_reporting(E_ALL);
  
   **require_once '/vendor/autoload.php';**
  
   use FormGuide\Handlx\FormHandler;
  
  
   $pp = new FormHandler(); 
  
   $validator = $pp-&gt;getValidator();
   $validator-&gt;fields(['Name','Email'])-&gt;areRequired()-&gt;maxLength(50);
   $validator-&gt;field('Email')-&gt;isEmail();
   $validator-&gt;field('Message')-&gt;maxLength(6000);
  
  
   $pp-&gt;requireReCaptcha();
   $pp-&gt;getReCaptcha()-&gt;initSecretKey('REMAINS SECRET :)');
  
  
   $pp-&gt;sendEmailTo('info@050management.nl'); 
  
   echo $pp-&gt;process($_POST);
  </code></pre>