Basically im trying to create a sudoku page, and the user inputs the numbers they want to into empty table cells and i want them to be able to save what they have done by clicking on a button. Ive got a two dimensional array but im not sure if it works because i dont know how to link the array with the button :/ im only just starting javscript at uni so im just a beginner. please help!



var current_cell = null; // the currently selected cell
var saved = {}; // Object for saving the current game

function initialize() {
var col, row;
// Work through all the cells in the table and set
// onclick event handlers and classNames for the empty
// ones.
for (row = 0; row <=8; row++) {
for (col=0; col <= 8; col++) {
var cell = document.getElementById('cell_' + col + '_' + row);
if (!parseInt(cell.innerHTML)) {
// cell is empty
cell.onclick = selectCell;
cell.className = 'tofill';
}
}
}
document.onkeypress = keyPress;
save();

}

var data = new array(9)
for (i=0; i <9 ; i++)
data[i] = new array(9)


data[0][0]: cell_0_0
data[1][0]: cell_1_0
data[2][0]: cell_2_0
data[3][0]: cell_3_0
data[4][0]: cell_4_0
data[5][0]: cell_5_0
data[6][0]: cell_6_0
data[7][0]: cell_7_0
data[8][0]: cell_8_0

data[0][1]: cell_0_1
data[1][1]: cell_1_1
data[2][1]: cell_2_1
data[3][1]: cell_3_1
data[4][1]: cell_4_1
data[5][1]: cell_5_1
data[6][1]: cell_6_1
data[7][1]: cell_7_1
data[8][1]: cell_8_1

data[0][2]: cell_0_2
data[1][2]: cell_1_2
data[2][2]: cell_2_2
data[3][2]: cell_3_2
data[4][2]: cell_4_2
data[5][2]: cell_5_2
data[6][2]: cell_6_2
data[7][2]: cell_7_2
data[8][2]: cell_8_2