We have all ran into the problem of existing contacts in your Keap/Infusionsoft account who suddenly decide to use new order information when completing a purchase which then creates a new contact record. I personally use 5 different email addresses at any given time which means this would create 5 new contact records.
To stop people from changing their email address. Add the following code to the custom footer code in your Keap/Infusionsoft order form.
<script>
jQuery(document).ready(function() {
function getUrlVar(key){
var result = new RegExp(key + “=([^&]*)”, “i”).exec(window.location.search);
if (result != null) {
if (result[1].substring(0,1) != “+”) {
result[1] = result[1].replace(/\+/g,” “);
} else {
result[1] = “+” + result[1].substring(1).replace(/\+/g,” “);
}
}
return result && result[1] || “”;
}
jQuery(‘#firstName’).val(decodeURIComponent(getUrlVar(‘FirstName’)));
jQuery(‘#lastName’).val(decodeURIComponent(getUrlVar(‘LastName’)));
jQuery(‘#zipCode’).val(decodeURIComponent(getUrlVar(‘PostalCode’)));
jQuery(‘#country’).val(decodeURIComponent(getUrlVar(‘Country’)));
jQuery(‘#phoneNumber’).val(decodeURIComponent(getUrlVar(‘PhoneNumber’)));
jQuery(‘#addressLine1’).val(decodeURIComponent(getUrlVar(‘StreetAddress1’)));
jQuery(‘#addressLine2’).val(decodeURIComponent(getUrlVar(‘StreetAddress2’)));
jQuery(‘#city’).val(decodeURIComponent(getUrlVar(‘City’)));
jQuery(‘#state’).val(decodeURIComponent(getUrlVar(‘State’)));
jQuery(‘#emailAddress’).val(decodeURIComponent(getUrlVar(‘Email’)));
jQuery(‘#promoCode’).val(decodeURIComponent(getUrlVar(‘promoCode’)));
});
jQuery(‘#emailAddress’).attr(‘readonly’, true);
</script>
When you send you contact records an email. You will want to link to the form like this example https://cu128.infusionsoft.com/app/orderForms/b1941e1d-d9b1-47a6-8711-684d94d95063?FirstName=~Contact.FirstName~&LastName=~Contact.LastName~&Email=~Contact.Email~
Notice the first name, last name and email address are all contained in the URL’s UTMs?
This will auto fill the first, last and email on the form.
To make first name and last name non editable, just add the following code to the above code on this page.
jQuery(‘#FirstName’).attr(‘readonly’, true);
jQuery(‘#LastName’).attr(‘readonly’, true);