Forum Moderators: open
<script language="JavaScript">
var DPArray = new Array();
var DPCount = 0;
function DPAdd_onclick()
{
DPArray[DPCount] = new Array();
DPArray[DPCount][0] = formvariable1;
DPArray[DPCount][1] = formvariable2;
...
DPCount++;
}
...
The idea is that form data will fill the array and the user can add as many records as needed while getting visual feedback on the page. So the feedback works, but the DPArray[DPCount] arrays go out of scope so I can't use this array to write to my database later in the process.
So is there anyway to force DPArray[DPCount] to be global from within the function? (like I can do in other languages)
Thanks