Thanks! I ended up using JavaScript instead. Here is the code:
<script>
document.addEventListener('DOMContentLoaded', function() {
var postalCodeField = document.getElementById('ID');
postalCodeField.addEventListener('input', function(event) {
var currentValue = event.target.value;
// Remove any existing spaces
var cleanedValue = currentValue.replace(/\s/g, '');
// Add space after third character
if (cleanedValue.length > 3) {
cleanedValue = cleanedValue.slice(0, 3) + ' ' + cleanedValue.slice(3);
}
event.target.value = cleanedValue;
});
});
</script>
Using Godaddy shared hosting and they don’t provide the option to update to PHP 7.4.
I tried everything, updating the function to _print in that file (line 9 and 223), reverting back to an older version, replacing the single welcome-panel.php file and still the form is not being sent.
This is the page https://www.abma.ca/contact-us/