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. Quote Link to comment 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; Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.