Same pattern: You are calling undesired variables from previous pages.
Attached for a quick demo. I cannot open 360 files out of my workplace
// Get the player object, which allows us to interact with variables
var player = GetPlayer();
// Function to remove the last character from a given variable
function removeLastCharacter(variableName) {
// Get the current value of the variable
var textEntry = player.GetVar(variableName);
// Check if the variable has any characters
if (textEntry.length > 0) {
// Remove the last character and update the variable
player.SetVar(variableName, textEntry.slice(0, -1));
}
}
// Create a mapping of focus variables to their corresponding input fields
var focusMap = {
"isDCFocused": "DCIDInput_FI",
"isDriverFocused": "DriverIDInput_FI",
"isTractorFocused": "TractorNumInput_FI"
};
// Loop through each focus variable in the mapping
for (var focusVar in focusMap) {
// Check if the current focus variable is true (i.e., the input field is focused)
if (player.GetVar(focusVar)) {
// Remove the last character from the corresponding input field
removeLastCharacter(focusMap[focusVar]);
}
}