I still have a problem. What I need is if neither box is selected, I get a alert, and if both are selected I get a alert.
(only one of the two can be selected)
The problem occurs in the 2rd part with the !, if only one is selected, I still get the alert, but I am using &&
Any suggestions?
if ((frm.rePaymentPeriod.value == ""
&& (frm.monthlyCost.value == ""
)
{
alert("You must choose either the montly \r"+
"cost or the repayment period field."
;
frm.monthlyCost.focus();
frm.monthlyCost.select();
return false;
}
if (((parseInt (frm.rePaymentPeriod.value) !== ""
&& (parseInt (frm.monthlyCost.value) !== ""
))
{
alert("You have selected both the montly \r"+
"cost and the repayment period fields.\r"+
"Please select only one."
frm.monthlyCost.focus();
frm.monthlyCost.select();
return false;
}
return true;
}
(only one of the two can be selected)
The problem occurs in the 2rd part with the !, if only one is selected, I still get the alert, but I am using &&
Any suggestions?
if ((frm.rePaymentPeriod.value == ""
{
alert("You must choose either the montly \r"+
"cost or the repayment period field."
frm.monthlyCost.focus();
frm.monthlyCost.select();
return false;
}
if (((parseInt (frm.rePaymentPeriod.value) !== ""
{
alert("You have selected both the montly \r"+
"cost and the repayment period fields.\r"+
"Please select only one."
frm.monthlyCost.focus();
frm.monthlyCost.select();
return false;
}
return true;
}