The input field must be replaced by . .
With HTM, this code works onkeyup="this.value = this.value.replace(/,/g,'.')"
But you need to use in php (with echo) as follows:
echo '<input type="text" name="amount_1" onkeyup="this.value = this.value.replace(/,/g,'.')" style="width:53px;"></input>';
It doesnβt work with php. If you use this this.value.replace(/,/g,/./) , Then , is replaced by /./ .
I tried (/,/g,"/./") , (/,/g,/"."/) , (/,/g,.) nothing works (I mean , doesnβt change to . ).
Any ideas?
source share