1

UPDATE:

Sorry I mean to say how may i use JS arrays with ajax?

user478636
  • 3,304
  • 15
  • 49
  • 76

2 Answers2

1

Arrays in javascript are very easy to use. To set up an array, simply set up the array like this.

var myArray = new Array(); 
myArray[0]="one value";      
myArray[1]="two value";
myArray[2]="three value"; //etc

You don't need AJAX to store data from a text box, as the DOM can grab the contents of a text box without any ajax calls.

In jQuery, you can get the contents of a text box like this $("#idofyourtextbox").val();

Reference: How do I get the value of a textbox using jQuery?

Community
  • 1
  • 1
Dave Harding
  • 481
  • 1
  • 4
  • 19
0

What about push

var array = new Array();

array.push(value);
Gowri
  • 16,587
  • 26
  • 100
  • 160