jQuery(document).ready(function(){ jQuery('#contact').html('

' + '
' + '
' + '
' + 'Reason for Contacting *:
' + '
' + '
' + '
' + '
' + '
' + '

' + 'Additional comments:
' + '
' + '
' + '
'); jQuery('#submitForm').on('click', function () { jQuery('#errors').html(''); var reasons = $('input[name="reason[]"]:checked').map(function(){ return $(this).val(); }).get(); jQuery.ajax({ type: "POST", url: "js/contact.js.php", data: ({json:'submit_contact', 'name':jQuery('#name').val(), 'company':jQuery('#company').val(), 'email':jQuery('#email').val(), 'phone':jQuery('#phone').val(), 'reason':reasons, 'comments':jQuery('#comments').val()}), dataType: 'json', success: function(json){ if (json.error) { jQuery('#errors').append('
'+json.error+'
'); } else { jQuery('#contact').html('

Your message was successfully sent!

'); } }, error: function(XMLHttpRequest, textStatus, errorThrown) { //alert(textStatus+" - "+errorThrown); } }); } ); }); function trackGAEvent(category, action, opt_label, opt_value) { opt_label = opt_label ? opt_label : ''; opt_value = opt_value ? opt_value : 1; _gaq.push(['_trackEvent', category, action, opt_label, opt_value]); }