答案 0 :(得分:0)
关于活动onclick'或者' onsubmit'或者' onblur'发生在提交按钮上,你调用一个javascript函数将它们转换为数值。
我建议你去了解javascript。
1) how read the value of the DOM element of your input field.
2)How to remove/(or replace with null) the characters except numbers from variable.(learn about regular expression in string replace/remove)
3) how to writes the value of variable to teh DOM element (Your's input field)
在提交表格之前这样做。
您可以参考How to make HTML input tag only accept numerical values?
中已提出的问题