/    Sign up×
Community /Pin to ProfileBookmark

How to check the object

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!!!!!!!

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@deep_dhyaniAug 03.2005 — You can check the object by [B]alert()[/B] method.
×

Success!

Help @Jacky spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.16,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...