Hi,
I was wondering if there is a way to have form prefill enabled, but exclude certain words from being prefilled. We use "not entered" on CRM imports to bypass required company and last name fields, but we want to make sure that if someone was created from a CRM import and has a last name or company of "not entered" that it does not get pulled into the form prefill. So essentially, we are hoping to find a way to exclude "not entered" from being populated on all of our forms while still keeping prefill enabled on these fields.
Thanks!
Solved! Go to Solution.
I was wondering if there is a way to have form prefill enabled, but exclude certain words from being prefilled.
Not natively, no. But it can be done easily. Add this JS just before the closing </head> tag:
(function(){
const effectivelyEmptyValues = ["not entered"];
Object.keys(mktoPreFillFields)
.forEach(function(fieldName){
const fieldValue = this[fieldName];
if(effectivelyEmptyValues.indexOf(fieldValue) != -1){
delete mktoPreFillFields[fieldName];
}
},mktoPreFillFields);
})();
I was wondering if there is a way to have form prefill enabled, but exclude certain words from being prefilled.
Not natively, no. But it can be done easily. Add this JS just before the closing </head> tag:
(function(){
const effectivelyEmptyValues = ["not entered"];
Object.keys(mktoPreFillFields)
.forEach(function(fieldName){
const fieldValue = this[fieldName];
if(effectivelyEmptyValues.indexOf(fieldValue) != -1){
delete mktoPreFillFields[fieldName];
}
},mktoPreFillFields);
})();