//https://nashvilledesignhousepainters.com/contact-us/ var callbackFuncForm2 = function(ev){ var leadSource = 'Website'; var status = 'New Lead'; //var lpUrl = window.location.href;//Edit with specific landing page url //Form specific url script //var name = jQuery('#fld_9014900_1').val(); //var emailAddress = jQuery('#fld_8004623_1').val(); //var interestedIn = jQuery('#fld_841260_1').val(); //var message = jQuery('#fld_4412757_1').val(); var first = jQuery("#wpforms-1296-field_19").val(); var last = jQuery("#wpforms-1296-field_19-last").val(); var phone = jQuery("#wpforms-1296-field_3").val(); var email = jQuery("#wpforms-1296-field_2").val(); var address1 = jQuery("#wpforms-1296-field_5").val(); var address2 = jQuery("#wpforms-1296-field_5-address2").val(); var city = jQuery("#wpforms-1296-field_5-city").val(); var state = jQuery("#wpforms-1296-field_5-state").val(); var zip = jQuery("#wpforms-1296-field_5-postal").val(); var heard_source = jQuery("#wpforms-1296-field_26").val(); var other = jQuery("#wpforms-1296-field_27").val(); var painting = jQuery("#wpforms-1296-field_25").val(); var day = jQuery("#wpforms-field_22-day").val() var month = jQuery("#wpforms-field_22-month").val() var year = jQuery("#wpforms-field_22-year").val() var fulldate = month + "/" + day + "/" + year; var matchbyfieldbody = { "133": email }; var contactfieldbody = { "99": first, "100": last, "57": phone, "133": email, "49": address1, "50": address2, "52": city, "53": state, "54": zip, "289": heard_source, "287": other, "288": painting, "70": leadSource, "56": status, "286": fulldate } var dataObject = [ { "function": "update-contact", "parameters": { "login-token": "B4827FEC-A833-4174-8302-CE5657551691",//replace with clients permanent token "match-by-field-data": matchbyfieldbody, "create-if-not-updated": "true", "contact-field-data": contactfieldbody }, "request-id": "Update a contact" } ]; jQuery.ajax({ type: "POST", url: "https://logon.salesnexus.com/api/call-v1", timeout: 10000, data: JSON.stringify(dataObject), dataType: "text", success: function (data) { }, error: function (result) { } }); return true; }; jQuery(document).on('click','#wpforms-submit-1296', callbackFuncForm2 ); //jQuery(document).on('click','#wpcf7-f571-p3533-o1 * button', callbackFuncForm2 ); //jQuery('#lp-pom-button-20').live( "click", callbackFuncForm2); function getParameterByName(name) { name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]"); var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"), results = regex.exec(location.search); return results === null ? "" : decodeURIComponent(results[1].replace(/\+/g, " ")); }