I have an array which I am storing inside an <input type="hidden">
. Here is my code.
Javascript:
var trees;
// called when the body loads
function BodyOnLoad()
{
trees = document.getElementById("trees");
trees.value = new Array();
}
// this is what isn't working
function AddTree()
{
var i = trees.value.length;
trees.value[i] = new Array();
/***/
trees.value[i]["branches"] = 5;
trees.value[i]["trunk"] = 0;
}
HTML: <input type="hidden" name="trees" id="trees" />
In C#, Request.Form["trees"]
is not an array. What am I doing wrong?