還缺少一個onchange處理,使用正則表達式的處理方式,
以下是限制文字的輸入
<style>
INPUT.num_text
{
imme-mode:disabled;
onkeydown: expression(onkeydown=function ()
{
var k=window.event.keyCode;
if(
k==46||k==8||k==189||k==109||k==190||k==110|| k>=48 && k<=57
||k>=96 && k<=105||k>=37 && k<=40 )
{
return true;
}
else if (k==13)
{
window.event.keyCode = 9;
return true;
}
else{
return false;
}
});
}
</style>
<form>
<input type="text" class="num_text" />
</form>
文章來源:
http://stocknewbie.bokee.com/viewdiary.18663505.html
posted on 2009-05-01 10:52
huohuo 閱讀(127)
評論(0) 編輯 收藏