Current location: Hot Scripts Forums » General Web Coding » JavaScript » length is 'null' or not an object


length is 'null' or not an object

Reply
  #1 (permalink)  
Old 10-08-04, 08:51 AM
shashiu shashiu is offline
New Member
 
Join Date: Oct 2004
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
length is 'null' or not an object

Hi,

I'm getting the above error when I try to call the function listed below onSubmit.

The function is:
function check(){
validateCheckbox();
validatef_819();
if(isStillLoading()) return false;
var cumparams = "";
for(j=0;j<document.forms.length;j++) {
var currform = document.forms[j];
for(i=0;i<currform.elements.length;i++) {
if(currform.elements[i].value!="null" && currform.elements[i].value!="" && leftString(currform.elements[i].name,2)=="f_"){
if(currform.elements[i].type=="select-one"){
cumparams += currform.elements[i].name+"="+currform.elements[i].options[currform.elements[i].selectedIndex].value+"|";
}
else if(currform.elements[i].type=="radio"){
if(currform.elements[i].checked)
cumparams += currform.elements[i].name+"="+currform.elements[i].value+"|";
}
else
cumparams += currform.elements[i].name+"="+currform.elements[i].value+"|";
}
}
}

for(j=0;j<document.forms.length;j++) {
document.forms[j].c_retain_form.value = cumparams;
//alert( "c_retain_form"+document.forms[j]+"="+document.forms[j].c_retain_form.value);
}
return (true);
}

and I'm calling the above function in the reference given below:

<form name=log action=dispatcher method=post onSubmit="return check()">

I've implemented the above in a jsp, which has 3 forms.

I tried to remove this funtion and tried accessing the page again, but still this error shows up.

Could anyone pls. help me solve this problem.

Thanks,
Shashi
Reply With Quote
  #2 (permalink)  
Old 10-15-04, 09:05 AM
TwoD TwoD is offline
Community VIP
 
Join Date: Sep 2003
Location: 404
Posts: 1,813
Thanks: 0
Thanked 0 Times in 0 Posts
You don't state on which row the error occurs or in which browser(s).
Try posting a link to the complete page if you still have the error and i'll take a look.
Tip: use the code wrapper (# icon in editing mode) when posting code
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
length is null or not an object SH6811 JavaScript 3 05-15-04 03:17 PM
login script cyberted Script Requests 2 05-06-04 01:57 AM
Newbie MySQL fccolon PHP 2 03-16-04 10:54 AM
picking random entries with a filter... Double selection problem dsumpter PHP 7 11-16-03 07:19 PM
Help with making a installer config script dazz Job Offers & Assistance 3 09-29-03 02:51 AM


All times are GMT -5. The time now is 10:31 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.