I wanted to use formulas for this initially but even though the variable linked to the input field no longer contained any letters, the input field itself still displayed everything that had been typed. So, I figured using oninput would be a better option in this case. Removing the comments did the trick, thank you for your help Lucas!