藍森林首頁 | 返回主頁 | 本站地圖 | 站內搜索 | 聯繫信箱 |
 您目前的位置:首頁 > 自由軟件 > 技術交流 > 應用編程


    

藍森林 http://www.lslnet.com 2006年8月25日 8:28

求救。怎樣強制input只能輸入小數或者整數。太謝謝了

比如:
onkeyup="value=value.replace(/[^\d]/g,'') "onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d]/g,''))"

追風好文章 >> 只能輸入數字 >> http://www.redea.net/gbmad/topic/20059/200591711440338.htm

/[^\d]/g
改成
/[^\d\.]/g

謝了




Copyright © 1999-2000 LSLNET.COM. All rights reserved. 藍森林網站 版權所有。 E-mail : webmaster@lslnet.com