function check(e) { var re = /^\d+(?=.{0,1}\d+$|$)/ if (e.value != "") { if (!re.test(e.value)) { alert("請輸入正確的數字"); e.value = ""; e.focus ...
function check(e) { var re = /^\d+(?=.{0,1}\d+$|$)/ if (e.value != "") { if (!re.test(e.value)) { alert("請輸入正確的數字"); e.value = ""; e.focus ...
<input type="text" placeholder="保留到小數點后兩位" maxlength="200" onkeyup="num(this)" onpaste="num(this)" /> //輸入和黏貼操作時觸發 //小數點后兩位 function num ...
輸入框input只能輸入數字和小數點 只允許輸入數字(整數:小數點不能輸入)<input type="text" onkeyup="value=value.replace(/[^\d]/g,'')" > 允許輸入小數(兩位小數)<input type ...
只允許輸入數字(整數:小數點不能輸入)<input type="text" onkeyup="value=value.replace(/[^\d]/g,'')" > 允許輸入小數(兩位小數)<input type="text" onkeyup="value ...
只允許輸入數字(整數:小數點不能輸入)<input type="text" onkeyup="value=value.replace(/[^\d]/g,'')" > 允許輸入小數(兩位小數)<input type="text" onkeyup="value ...
只允許輸入數字(整數:小數點不能輸入)<input type="text" onkeyup="value=value.replace(/[^\d]/g,'')" > 允許輸入小數(兩位小數)<input type="text" onkeyup="value ...
<input type="text" class="txt NumText" Width="100px" /> $(function(){ /*JQuery 限制文本框只能輸入數字 ...
)) { alert("請輸入正確的數字"); e.value = ""; ...