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

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
User avatar
JayBird
Admin
Posts: 4524
Joined: Wed Aug 13, 2003 7:02 am
Location: York, UK
Contact:

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

Post 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:
Syranide
Forum Contributor
Posts: 281
Joined: Fri May 20, 2005 3:16 pm
Location: Sweden

Post 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?
User avatar
JayBird
Admin
Posts: 4524
Joined: Wed Aug 13, 2003 7:02 am
Location: York, UK
Contact:

Post 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; 
		} 
	}
Post Reply