client scripts > global > pages with header/footer > startup scriptthen i add this code for replace old words with new words >> this work for all html input fields and all modal input fieldsput this code without the code:
function replaceWords(inputText) {
var oldWords = ["old1","old2","old3"];
var newWords = ["new1","new2","new3"];
for (var i = 0; i < oldWords.length; i++) {
var regex = new RegExp(oldWords[i], "gi");
inputText = inputText.replace(regex, newWords[i]);
}
return inputText;
}
// Event listener for input changes
function handleInputChange(event) {
var inputValue = event.target.value;
var replacedValue = replaceWords(inputValue);
// Update the input value with the replaced text
event.target.value = replacedValue;
}
// Apply the event listener to all input elements
var inputElements = document.querySelectorAll('input');
inputElements.forEach(function (input) {
input.addEventListener("input", handleInputChange);
});
// Apply the event listener to all modal inputs when the modal is shown
$('.modal').on('shown.bs.modal', function () {
var modalInputElements = this.querySelectorAll('input');
modalInputElements.forEach(function (input) {
input.addEventListener("input", handleInputChange);
});
});