function Num(obj){
obj.value=obj.value.replace(/[^\d.]/g, "");
obj.value=obj.value.replace(/^\./g, "");
obj.value = obj.value.replace(/\.{2,}/g, ".");
obj.value = obj.value.replace(".","$#$" ).replace(/\./g,"" ).replace("$#$" ,"." );
}
< tr>
<td align ="right" style="font-weight:700">监测范围上限: </td >
<td align ="left">
<input onkeyup ="Num(this)" id ="jcfwsx" name= "xmjbxx.jcfwsx" type ="text" class="w_260" value= "${xmjbxx.jcfwsx } " dataType ="Require" msg="必填"/>
</td >
</tr >
项目经验:求一段js 要求实现只能输入数字小数点、其他输入不进去
这是一个关于技术领域的博客,涵盖了从前端到后端开发、移动开发、游戏开发、大数据开发等广泛的技术话题。

被折叠的 条评论
为什么被折叠?



