Asheeown Posted May 10, 2009 Share Posted May 10, 2009 I have var x = Questions[i]; var length = document.form1.q_x.length; I need x to actually show the variable in the command If you do var x = Questions[i]; var length = 'document.form1.q_'+x+'.length'; It just prints the command as plain text. Link to comment https://forums.phpfreaks.com/topic/157590-variable-in-command/ Share on other sites More sharing options...
Ken2k7 Posted May 10, 2009 Share Posted May 10, 2009 That is *horrible* format. var x = Questions[i]; var length = document.forms.form1['q_' + x].length; Link to comment https://forums.phpfreaks.com/topic/157590-variable-in-command/#findComment-831119 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.