<input type=text name=summoney OnKeyDown="javascript:test()">
function test()
{
var reg = /[.-1-9]/
return (reg.test(event.KeyCode))
}
大概是这样吧!

解决方案 »

  1.   

    二个金额都没有输入的时候累加为何不行啊?
    f14没有输入
    f25也没有输入
    f1也没有输入
    下面这样返回都是false
    var num14=parseFloat(document.theForm.f14.value)
    var num25=parseFloat(document.theForm.f25.value)

    if(parseFloat(document.theForm.f1.value)!=(num14+num25)) 
    {
    alert("总资产<>负债+所有者权益");
    return false;
    }
      

  2.   

    你alert(num14)来看看
    估计不是0吧
    var num14=(document.theForm.f14.value == "")? 0 : parseFloat(document.theForm.f14.value)