0

I'm displaying an asp.net checkbox list in a jquery dialog box. the user will be able to select/unselect items and either hit OK, Cancel, or just close the jquery dialog. When the user closes the dialog, i want to undo the changes and restore default settings on client side.

I was thinking of doing someting like this - OnInit or something then javascript to store default values in array. when the jquery dialog is cancelled, unselect all and select default values array.

i can do the 2nd part of this. but i dont know how to store default values in array.

pls help!

1 Answers1

0

This help you:

var a = 1;
var all = new Array();
for(i=0;i<4;i++)
{
    all[i]=a;
    a++;
}

Or this

Array.prototype.repeat= function(what, L){
 while(L) this[--L]= what;
 return this;
}

var A= [].repeat(0, 24);

alert(A)

These answers I got here, SOen.

First

Second

Community
  • 1
  • 1