Connecting Tech Pros Worldwide Help | Site Map

form.elements[x] has no properties

  #1  
Old July 20th, 2005, 12:23 PM
jeep@13.usenet.us.com
Guest
 
Posts: n/a
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, 12:23 PM
Lasse Reichstein Nielsen
Guest
 
Posts: n/a

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, 12:23 PM
jeep@13.usenet.us.com
Guest
 
Posts: n/a

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
Closed Thread


Similar Threads
Thread Thread Starter Forum Replies Last Post
javscript: variable has no properties sagel answers 2 May 1st, 2008 02:49 PM
Error: document.getElementById("ff") has no properties linuxnooby@yahoo.com.au answers 6 December 5th, 2006 07:25 PM
yet another 'object has no properties' error droesler@comcast.net answers 3 September 29th, 2006 07:45 AM
another document.[formName] has no properties error michael answers 7 October 10th, 2005 06:35 PM
element.children has no properties (mozilla only) Luke Dalessandro answers 6 July 23rd, 2005 10:32 PM