Does anybody know how to change an entered symbol seamlessly with javascript? Because when I just replace an already-printed symbol with the desired one (something like onkeyup=”this.value=this.value.replace(/,/g,’.’)”), the user sees the replacement occur: you press comma, comma is printed, then it’s replaced by a dot. Of course, it happens quickly so it’s not a big problem, but anyway I want the dot to be printed immediately without printing and replacing the comma first. Is it possible?
Does anybody know how to change an entered symbol seamlessly with javascript? Because when
Share
You will have to cancel default event and add the other character to the input manually
Look at this question it should help you: how to insert dot instead of comma in js keypress