When i want submit the form, it will prompt the error, the error are “document.all.supl_cde.value” is null or not an object, so what is happen.
<form name=”transaction” method=”post” onSubmit= “returnAction();”>
function returnAction(){
var dateChecked = 1;
var rowChecked = 1;
dateChecked = dateValidate();
rowChecked = checkDuplicateRow();
if(document.all.rea_cde.value == “select”){
alert(“Please select the Reason Code from the options list.”);
return false;
}
else if(document.all.doc_no.value == “”){
alert(“Please fill in the Document No. “);
return false;
}
else if(document.all.em_cde.value == “select”){
alert(“Please select the Received By from the options list.”);
return false;
}
else if(document.all.supl_cde.value == “”){
alert(“Please select Supplier from the options list.”);
return false;
}
//check if there is no material selected for the DO … …
if(eval(“document.all.hid_line.value”)<1){
alert(“Please fill in material received ANDn PO Number and PO line”);
eval(“document.all.selectButton1”).focus();
return false;
}
// check if material is selected but quantity is not being filled before fproceed to next page
else if(eval(“document.all.hid_line.value”)>=1){
var row = parseInt(eval(“document.all.hid_line”).value);
var count = 0;
for(var line=1; line<=row; line++){
if(eval(“document.all.rec_qty”+line).value == “”){
alert(“Please fill in Received Quantity for line”+line);
eval(“document.all.rec_qty”+line).focus();
return false;
break;
}
else if(eval(“document.all.in_pur_um”+line).value == “”){
alert(“Please fill in received material UM”);
eval(“document.all.in_pur_um”+line).focus();
return false;
break;
}
if(!checkUM(line)){
return false;
break;
}
if(eval(“document.all.remove”+line+”.value”)==”YES” ){
count++;
}
}
if(count == row){
alert(“You cannot removed all the item!”);
return false;
}
}
if(dateChecked ==0||rowChecked ==0){
return false;
}
else{
if(document.all.hid_page.value == “edit”){
unLockFields();
return(transaction.action=’edit_confirmation.jsp’);
}
else if(document.all.hid_page.value == “main”){
unLockFields();
return(transaction.action=’detail_confirmation.jsp’);
}
}
}
THANKS for helping!!!!!!!