<input type=text name=text0 onkeypress=woyingjie(this.value,1)>
<input type=text name=text1 onkeypress=woyingjie(this.value,2)>
<input type=text name=text2 onkeypress=woyingjie(this.value,3)>
<input type=text name=text3>
<script>
function woyingjie(hoho,i){
if(hoho.indexOf(".")>-1){
document.all("text"+i).focus();
}
}
</script>

解决方案 »

  1.   

    用KEYDOWN事件控制﹐如果按下的是"."﹐就把KEYCODE改為9﹐TAB到下一個框
      

  2.   

    <input type=text name=text0 onpropertychange=woyingjie(this.value,1)>
    <input type=text name=text1 onpropertychange=woyingjie(this.value,2)>
    <input type=text name=text2 onpropertychange=woyingjie(this.value,3)>
    <input type=text name=text3>
    <script>
    function woyingjie(hoho,i){
    if(hoho.indexOf(".")>-1){
    document.all("text"+(i-1)).value=hoho.substring(0,hoho.length-1)
    document.all("text"+i).focus();
    }
    }
    </script>