Page 1 of 1

Simple javascript...have i gone mad???

Posted: Wed Jun 22, 2005 4:30 am
by JayBird
Right, i think i have gone mad or something becuase i have completely forgotten how to do this

tkae this as an example...arrayData contains a list of radio button names

Code: Select all

for( i in arrayData ) { 
		if (document.survey.arrayDataїi].checked == false) {
			errorCheck = 1; 
		} 
	}
how do i indicate arrayData is NOT the name of the radio button, but infact the string in that array index is the name.

:roll:

Posted: Wed Jun 22, 2005 4:35 am
by Syranide
edit aha, you can't do like that... as arrayData would be assumed to be a member... if you want a specific object I believe there is a get/find function which takes an id and returns the object?

Posted: Wed Jun 22, 2005 4:54 am
by JayBird
im not quite yet in the mad house.

done it

Code: Select all

for( i in arrayData ) { 
		if (document.surveyїarrayDataїi]].checked == false) {
			errorCheck = 1; 
		} 
	}