Here's my script: function addCustomField() { const inputElement = document.getElementById("buildship-chat-widget__input"); if (inputElement) { // Check if the hidden input already exists by name or id if (!document.querySelector('input[name="user_role"]')) { // Create hidden input element const hiddenInput = document.createElement("input"); hiddenInput.type = "hidden"; hiddenInput.name = "user_role"; // Add name attribute hiddenInput.value = "default_role"; // You can customize this value as needed // Insert the hidden input after the input element inputElement.parentNode.insertBefore(hiddenInput, inputElement.nextSibling);