欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

js判斷價(jià)格,必須為數(shù)字且不能為負(fù)數(shù)的實(shí)現(xiàn)方法

 更新時(shí)間:2016年10月07日 11:20:41   投稿:jingxian  
下面小編就為大家?guī)硪黄猨s判斷價(jià)格,必須為數(shù)字且不能為負(fù)數(shù)的實(shí)現(xiàn)方法。小編覺得挺不錯(cuò)的,現(xiàn)在就分享給大家,也給大家做個(gè)參考。一起跟隨小編過來看看吧

如下所示:

<pre name="code" class="html"><input type="text" onpaste="if(IsNum(window.clipboardData.getData('text'))==false) return false;" class="input-txt-small" id="productPrice" onblur="checkprice('productPrice','pricedw')" 
                  onkeyup="if(isNaN(value))execCommand('undo')" onafterpaste="if(isNaN(value))execCommand('undo')" />元</pre><br> 
function IsNum(num){ var reNum=/^\d*$/; if(reNum.test(num)) { return true; } else { if(num < 0) { alert("價(jià)格不能為負(fù)數(shù)!"); } else { alert("價(jià)格必須為數(shù)字!"); } return false; }} 
<pre></pre> 
<p><br> 
</p> 
<p></p><pre name="code" class="javascript"><pre name="code" class="html">window.clipboardData.getData('text')</pre><p></p> 
<pre></pre> 
為獲取粘貼的內(nèi)容<br> 
<p></p> 
   
</pre> 

以上就是小編為大家?guī)淼膉s判斷價(jià)格,必須為數(shù)字且不能為負(fù)數(shù)的實(shí)現(xiàn)方法全部內(nèi)容了,希望大家多多支持腳本之家~

相關(guān)文章

最新評論