.numeric函數(http://www.texotela.co.uk/code/jquery/numeric/)非常好用,但是當您將內容粘貼到txtOrderName字段中並且您退出該字段時它不驗證。jQuery .numeric和粘貼內容
有沒有人知道任何修改,將允許內容粘貼後再次運行.numeric函數?
例如,如果我將'4,00'粘貼到txtOrderPrice字段中,我不希望顯示逗號(,)。如果在字段中輸入「4,00」(數字變爲「400」),數字函數將忽略此項。但知道他們可能只是將'4,00'粘貼到現場並填滿東西。
<script type="text/javascript" src="jquery.numeric.js"></script>
$(document).ready(function() {
$(".numeric").numeric();
});
</script>
<input class="numeric" type="text" id="txtOrderPrice" name="txtOrderPrice_name" maxlength="128" />
的感謝!你的幫助指向了我正確的方向。 注意自我:一定要記得檢查一下你有最新版本的js文件。我使用的是numeric.js v1.2而不是v1.3 – user723217