LyndonOHRC
Programmer
I'm really stuck here. I'm hoping it's something obvious to some of you.
I'm just trying to validate some form values but it looks to me like no code after the first if condition ever runs.
No expert here. Except for the error I can't seem to spot, I found all of these methods searching this board.
Any help appreciated.
Lyndon
I'm just trying to validate some form values but it looks to me like no code after the first if condition ever runs.
No expert here. Except for the error I can't seem to spot, I found all of these methods searching this board.
Any help appreciated.
Lyndon
Code:
<form name="FacilityEmployeeReceipt" action="FacilityEmployeeReceiptPrint.cfm" method="post" onsubmit="return validateform()">
Code:
function validateform(){
var AlertMessage='';
if (trim(document.FacilityEmployeeReceipt.ReceiptDate)==""){
AlertMessage='Receipt Date is Required';
}
if (trim(document.FacilityEmployeeReceipt.ReceiptNumber.value)==""){
AlertMessage='Receipt Number is Required';
}
if (trim(document.FacilityEmployeeReceipt.CheckNumber.value)==""){
AlertMessage='Check Number is Required';
}
if (ParseInt(document.FacilityEmployeeReceipt.CheckAmount.value)==0){
AlertMessage='Check Amount is Required';
}
if (!IsValid){
alert(AlertMessage);
return false;
}
return true;
}