I have declared an array in a hidden input in my HTML form. Now I want to access that array in a Javascript function. For this, I have written the following code:
<form name="form1">
<input type="hidden" name="sq[]" ></input>
<input type="hidden" name="a" ></input>
</form>
And in the Javascript function:
function myfunction()
{
document.form1.a.value=i; // Here, I can access the variable 'a'
// (since a is not in the form of array)
var i;
for(i=0;i<4;i++)
{
document.form1.sq[i].value=i; // Here, I am not able to access array named sq[].
}
}