Ahh this is tough, I just don't get why it is not more descriptive with what
I can do to fix it. Errors updated: (i think), but STILL getting error. Line:
var val = parsefloat(fld.value.replace(/[\s\,\$]/g, ""));
My OVERALL GOAL IS TO SIMPLY VALIDATE: total small commercial must be <=
total commercial
<script type="text/javascript">
function numOnly(fld) {
// parseFloat parses its argument, a string, and returns a floating point
number
var val = parsefloat(fld.value.replace(/[\s\,\$]/g, "")); // remove spaces,
commas and dollar signs
// isNaN = Not-a-Number -- output is true or false
if (isNaN(val)) {
alert("The value " + fld.value + " is not a valid number or currency.");
val = null;
}
return val;
}
function formVal() {
var frm = document.agencyform2;
var v1 = numOnly(frm.cltav05);
var v2 = numOnly(frm.sctav05);
if (v1 === null || v2 === null) {
return false; // error message already displayed
}
if (v1 < v2)
{
alert("Error - Business Level Validation");
return false;
}
return true;
}
</script>
Peter Torr (MS) - 23 May 2006 21:29 GMT
> var val = parsefloat(fld.value.replace(/[\s\,\$]/g, ""));
You want "parseFloat" -- JScript is case sensitive.
Peter

Signature
Peter Torr - http://blogs.msdn.com/ptorr
HD DVD Program Manager