wondering if there was anyway to assign a variable dynamically when looping: view code below:
for(nLoopCount = 1; nLoopCount < playerCount; nLoopCount++)
{
var playerStatus = document.write("form." + "position" + nLoopCount + ".selectedIndex"
}
WHAT I'D LIKE TO DO IS ASSIGN PLAYERSTATUS = FORM.POSITION[NUMBER].SELECTEDINDEX EACH TIME THROUGH THE LOOP. MY PROBLEM IS WHEN I ASSIGN IT TO THIS STRING, IT STAYS A STRING.
I want:
form.position1.selectedIndex
form.position2.selectedIndex
...
i want these equal to values, not just "form.position1.selectedIndex"....is there anything like Response.Write like in .ASP?
DO YOU GUYS HAVE ANY IDEAS? thanks.
for(nLoopCount = 1; nLoopCount < playerCount; nLoopCount++)
{
var playerStatus = document.write("form." + "position" + nLoopCount + ".selectedIndex"
}
WHAT I'D LIKE TO DO IS ASSIGN PLAYERSTATUS = FORM.POSITION[NUMBER].SELECTEDINDEX EACH TIME THROUGH THE LOOP. MY PROBLEM IS WHEN I ASSIGN IT TO THIS STRING, IT STAYS A STRING.
I want:
form.position1.selectedIndex
form.position2.selectedIndex
...
i want these equal to values, not just "form.position1.selectedIndex"....is there anything like Response.Write like in .ASP?
DO YOU GUYS HAVE ANY IDEAS? thanks.