HEX
Server: Apache/2.4.41
System: Linux mainweb 5.4.0-182-generic #202-Ubuntu SMP Fri Apr 26 12:29:36 UTC 2024 x86_64
User: nationalmedicaregrp (1119)
PHP: 8.3.7
Disabled: exec,passthru,shell_exec,system,popen,proc_open,pcntl_exec
Upload Files
File: /home/demo/public_html/roofleak/assets/js/mailer.js
jQuery(document).ready(function($) {

  var $feedbackContainer = $('#submitResult');

  $("#submit-btn").on('click', function(){

      var passedValidation = true;        
      //form validation

      //form handling
      if(passedValidation) {
          //create an object with input field data to be sent to server
          post_data = {
              'firstname'    : $('input[name=first-name]').val(), 
              'lastname'       : $('input[name=lastname]').val(), 
              'email'         : $('input[name=email]').val(), 
              'phone'       : $('input[name=phone]').val(), 
              'zipcode'       : $('select[name=zipcode]').val()
          };

          //AJAX for processing form
          $.post( 'js/engine/process_contactForm.php',
                  post_data,
                  function(response) {
                      //message text
                      $feedbackMessage = '<p>Show whether sending the form worked</p>';

                      $feedbackContainer.html($feebackMessage).removeClass('hidden');
                      $('#contactForm').hide();
                  }, //end of callback
                  'json'
          );

      } //end of form handlings       
  }); // end of submission event
}); // end of script