5
I want when a user type ,
(comma), this is replaced by .
(point). But when I insert the script below, it shows no result.
Can someone help me find the mistake?
function substituiPonto(){
valor = document.calcform.visor.value;
while(valor.indexOf(".") >= 0) {
novoValor = valor.replace(",",".");
}
valor = novoValor;
}
<body>
<form name="calcform" method="post" action="">
<input type="text" name="visor" id="visor" value="" onKeyPress="substituiPonto()"/>
</form>
</body>
Remember to mark an answer as certain if any has solved your friend problem, so other people who search will also be helped.
– Bruno Romualdo