Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

store data in two dimensional array

sono82sono82 Member Posts: 5
i want to ask, how do we want to store data in two dimensional array?

let say for example, i have 3 select options.


a
b


1
2


z
y



my first question...
how to automatically save this data into array,
e.g:User select b,2,z
-the array should be "var data=["b", "2", "z"];
-the array can be incremental, after user click button, then he/she can add more items into data array..

i hope someone understands me.. can anybody help me?
please...
regards

Comments

  • NCS_OneNCS_One Member Posts: 170
    : i want to ask, how do we want to store data in two dimensional array?
    :
    : let say for example, i have 3 select options.
    :
    :
    : a
    : b
    :
    :
    : 1
    : 2
    :
    :
    : z
    : y
    :
    :
    :
    : my first question...
    : how to automatically save this data into array,
    : e.g:User select b,2,z
    : -the array should be "var data=["b", "2", "z"];
    : -the array can be incremental, after user click button, then he/she can add more items into data array..
    :
    : i hope someone understands me.. can anybody help me?
    : please...
    : regards
    :

    Hi

    http://programmersheaven.com/c/MsgBoard/read.asp?Board=35&MsgID=320094&Setting=A9999F0002
  • sono82sono82 Member Posts: 5
    but the data in the array are inserted dynamically when user click the button. From the reply that been given by cyguy, it seems that the data is hard coded. sorry for the lots of question, i'm a newbie here, and i am really bad in programming. But still my bos gives me programming, i am really bad in this, so pls help me :(
  • NCS_OneNCS_One Member Posts: 170
    : but the data in the array are inserted dynamically when user click the button. From the reply that been given by cyguy, it seems that the data is hard coded. sorry for the lots of question, i'm a newbie here, and i am really bad in programming. But still my bos gives me programming, i am really bad in this, so pls help me :(
    :

    Hi

    To enter data in the array you only have to see its length and put
    the data at that position in the array.
    If the length its 3 then you have data in the array at positions
    0, 1, and 2.
    [code]
    var Data = new Array();

    Data[Data.length] = "A"; //in this case the length is 0, im putting
    the "A" in the position 0 of the array.

    Data[Data.length] = "B"; //in this case the length is 1, im putting
    the "B" in the position 1 of the array.

    Data[Data.length] = "C"; //in this case the length is 2, im putting
    the "C" in the position 2 of the array.
    [/code]
    You only have to declare the var Data = new Array(); in the beginnig
    of the code than you can use it any were in the code.

    Hope it helps.
    If you have any more questions just ask.
Sign In or Register to comment.