By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,607 Members | 1,944 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,607 IT Pros & Developers. It's quick & easy.

form.elements[x] has no properties

P: 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
Jul 20 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
je**@13.usenet.us.com writes:
I get this in the following javascript:

Error: form.elements[x] has no properites
So x is probably too large.
function check_elems(form,q,st,end) {
var flag = false;


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

/L
--
Lasse Reichstein Nielsen - lr*@hotpop.com
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleDOM.html>
'Faith without judgement merely degrades the spirit divine.'
Jul 20 '05 #2

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


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

Thank you!
Jeff
Jul 20 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.