My Javascript works if the name of the checkboxes is written in the following way:

<input type=checkbox name=cbPick1>
<input type=checkbox name=cbPick2> and so on.

However, I need to change it to:

<input type=checkbox name=cbPick[1]>
<input type=checkbox name=cbPick[2]>, because my PHP scripts are written to understand in this way.

I wonder how I should change the following Javascript so that it understands cbPick[1] instead of cbPick1:


function SelectNumber(number)
{
var IsChecked = 0;
if (!document.lot["cbPick" + number])
{ return; }
for( j=1;j<number;j++)
{
if (document.lot["cbPick" + j].checked)
{
continue;
}
document.lot["cbPick" + j].checked =1;
document.lot["cbPick" + j].checked =0;
}
document.lot["cbPick" + j].checked=1;
Refresh();
}

function QuickPick()
{
ClearBoard()
var MaxNumber = "7";
var HiNumber = 40 - 1;
var Number = 0;
while ( Number < MaxNumber )
{
var number = (Math.random() * HiNumber) + 1;
number = Math.round(number);
if (!document.lot["cbPick" + number].checked)
{
SelectNumber(number);
Number++;
}
}
}


Thank you.