Block empty forms in LMFX but not through Feature Activation

gerard_reyes Posted by: Gerard Reyes Date Posted: August 27, 2025
Back to Case Studies

Issue

Blank forms are being captured by LeadManagerFX. For some reason, the do not capture blank form settings in Feature Activation is not working for this client’s form.

Solution

Created a custom code to block the capture event of LMFX using onFormCapture.

<script>
mcfx(function(t) {
t.configure("onFormCapture", function(form) {
var contactEmail = form.elements['contact-email'];
var yourName = form.elements['your-name'];
var yourPhone = form.elements['your-phone'];
var yourMessage = form.elements['your-message'];

if (contactEmail && contactEmail.value.trim() === '') {
console.log('Will not capture due to empty input reason!');
return false;
}

if (yourName && yourPhone && yourMessage &&
yourName.value.trim() === '' &&
yourPhone.value.trim() === '' &&
yourMessage.value.trim() === '') {
console.log('Will not capture due to empty inputs reason!!');
return false;
}
});
});
</script>

Achievement

Blank forms are not captured anymore.

Snippet/Screenshot/Link

Task: Link

Code: Screenshot