在输入字段中需要替换,为..
使用 HTM,这样的代码可以工作onkeyup="this.value = this.value.replace(/,/g,'.')"
但是需要像这样在php中使用(带有echo):
echo '<input type="text" name="amount_1" onkeyup="this.value = this.value.replace(/,/g,'.')" style="width:53px;"></input>';
用php不行。如果使用它this.value.replace(/,/g,/./),则,替换为/./.
试过了,(/,/g,"/./")没有任何效果(我的意思是不会更改为)。(/,/g,/"."/)(/,/g,.),.
有任何想法吗?