Pay me to get priority support.
Add a Text or Hidden Field to top of Form. Find ID of Field
Then Use code to Code Injection > Footer (or Page Header Injection)
<script>
(function() {
function triggerInputChange(inputElement, value) {
const nativeInputValueSetter = Object.getOwnPropertyDescriptor(
window.HTMLInputElement.prototype,
"value"
).set;
nativeInputValueSetter.call(inputElement, value);
const inputEvent = new Event("input", { bubbles: true });
inputElement.dispatchEvent(inputEvent);
}
function setupNameConcatenation(form) {
const subj = form.querySelector('div#text-f387e2bc-1190-432a-836c-008b221d7a2a input');
const fn = form.querySelector('input[name="fname"]');
const ln = form.querySelector('input[name="lname"]');
if (subj && fn && ln && !form.dataset.nameConcatenationSetup) {
form.dataset.nameConcatenationSetup = 'true';
let isUpdating = false;
const update = () => {
if (isUpdating) return;
isUpdating = true;
setTimeout(() => {
const fname = fn.value || '';
const lname = ln.value || '';
const fullName = (fname + ' ' + lname).trim();
if (fullName && fullName !== ' ') {
triggerInputChange(subj, fullName);
}
isUpdating = false;
}, 50);
};
fn.addEventListener('input', update);
ln.addEventListener('input', update);
form.addEventListener('submit', function(e) {
if (!isUpdating) {
update();
}
});
}
}
document.addEventListener('DOMContentLoaded', function() {
const forms = document.querySelectorAll('form');
forms.forEach(function(form) {
setupNameConcatenation(form);
});
});
const observer = new MutationObserver(function(mutations) {
mutations.forEach(function(mutation) {
if (mutation.addedNodes && mutation.addedNodes.length > 0) {
for (let i = 0; i < mutation.addedNodes.length; i++) {
const node = mutation.addedNodes[i];
if (node.nodeType === 1) {
let forms = node.querySelectorAll ? node.querySelectorAll('form') : [];
if (node.matches && node.matches('form')) {
forms = [node, ...forms];
}
forms.forEach(function(form) {
setupNameConcatenation(form);
});
}
}
}
});
});
observer.observe(document.body, {
childList: true,
subtree: true
});
})();
</script>