Okay, I'm still kind of new at javascripting, and I think there's a lot of quirks that I still need to learn. Take the following java function:

function sumparts(_f) {
_f.PHTAMT.value = 0;
_f.PMBAL.value = 0;
if (!isNaN(parseInt(_f.CBAMT.value)) ) {
if (parseInt(_f.CBAMT.value) > 0 ) {
_f.PMBAL.value = parseInt(_f.OLDPMBAL.value) - parseInt(_f.CBAMT.value);
_f.PHTAMT.value = parseInt(_f.CBAMT.value);
}
if (parseInt(_f.OLDPMBAL.value) < parseInt(_f.CBAMT.value)) {
alert("Withdrawal amount is more than current balance");
return false;
}
else {
if ((_f.PMBAL.value < 50) && (_f.PMBAL.value > 0)) {
alert("Withdrawal amount leaves current balance under property minimum. Either 0 your account or adjust your withdrawal to leave the minimum amount in your account.");
return false;
}
}
}
else {
alert("Fields must contain Numbers");
return false;
}
}


See the hard coded "50" in the last if clause? Well, this should be the variable, VarPRMIND. Anytime I try to add it to this function, it ends up making the entire function dysfunctional...hehe! VarPRMIND is a variable available to the HTML block that is calling this java function. When I try to define VarPRMIND in the function, it stops working...WHY? Here's what I added;

function sumparts(_f) {
mNv = _f.VarPRMIND
_f.PHTAMT.value = 0;
_f.PMBAL.value = 0;
if (!isNaN(parseInt(_f.CBAMT.value)) ) {
if (parseInt(_f.CBAMT.value) > 0 ) {
_f.PMBAL.value = parseInt(_f.OLDPMBAL.value) - parseInt(_f.CBAMT.value);
_f.PHTAMT.value = parseInt(_f.CBAMT.value);
}
if (parseInt(_f.OLDPMBAL.value) < parseInt(_f.CBAMT.value)) {
alert("Withdrawal amount is more than current balance");
return false;
}
else {
if ((_f.PMBAL.value < 50) && (_f.PMBAL.value > 0)) {
alert("Withdrawal amount leaves current balance under property minimum. Either 0 your account or adjust your withdrawal to leave the minimum amount in your account.");
return false;
}
}
}
else {
alert("Fields must contain Numbers");
return false;
}
}


I've tried numerous variations to define this field in the function, but to no avail. How in the world can I get this variable to work in this function? I would just pass it into the function as a parm, but it's already using "_f "...the call to the function looks like this;

<input type="text" name="CBAMT" size="13" maxsize="12" onchange="sumparts(this.form);">