<input type=text name=summoney OnKeyDown="javascript:test()">
function test()
{
var reg = /[.-1-9]/
return (reg.test(event.KeyCode))
}
大概是这样吧!
function test()
{
var reg = /[.-1-9]/
return (reg.test(event.KeyCode))
}
大概是这样吧!
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;
}
估计不是0吧
var num14=(document.theForm.f14.value == "")? 0 : parseFloat(document.theForm.f14.value)