Connecting Tech Pros Worldwide Help | Site Map

form.elements[x] has no properties

 
LinkBack Thread Tools Search this Thread
  #1  
Old July 20th, 2005, 11:23 AM
jeep@13.usenet.us.com
Guest
 
Posts: n/a
Default form.elements[x] has no properties

I get this in the following javascript:

Error: form.elements[x] has no properites

For the following function:

function check_elems(form,q,st,end) {
var flag = false;
if (end < st) { alert("check_elems(): invalid st "+st+" and end "+end); }
for (var x = st; x <= end; x++) {
//alert(x);
if (form.elements[x].checked) {
flag = true;
}
}
if (!flag) {
// alert("Please answer question " + q +
// " and any others you may have forgotten.");
}
return flag;
}

After hours of trying to find the answer, I give up!

Any help is appreciated,
Jeff



  #2  
Old July 20th, 2005, 11:23 AM
Lasse Reichstein Nielsen
Guest
 
Posts: n/a
Default Re: form.elements[x] has no properties

jeep@13.usenet.us.com writes:
[color=blue]
> I get this in the following javascript:
>
> Error: form.elements[x] has no properites[/color]

So x is probably too large.
[color=blue]
> function check_elems(form,q,st,end) {
> var flag = false;[/color]

Add:
if (end >= form.elements.length) { alert ("this is not happening!");}
and see if it is happening.

/L
--
Lasse Reichstein Nielsen - lrn@hotpop.com
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleDOM.html>
'Faith without judgement merely degrades the spirit divine.'
  #3  
Old July 20th, 2005, 11:23 AM
jeep@13.usenet.us.com
Guest
 
Posts: n/a
Default Re: form.elements[x] has no properties

>> Error: form.elements[x] has no properites
[color=blue]
> So x is probably too large.
> Add:
> if (end >= form.elements.length) { alert ("this is not happening!");}
> and see if it is happening.[/color]

Oh DUH! You are right. I split up a very long page and never changed
the element numbers!

Thank you!
Jeff
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,989 network members.