Jump to content

Sending arrays with AJAX


killboy

Recommended Posts

Hi there.Can anyone tell me how to send an array with AJAX?For example, I have

<input type="text" name="modulo[]">

I want to send the values when I get a collection by the getElementsByName property.Thanks for the help.

Link to comment
Share on other sites

I believe you can only send string data through an HTTP request. So, if you want to send an array, you'll have to serialize it into a string first and then deserialize it on the server to turn it back into an array.One easy way with arrays is to join the elements into a comma-delimited string and then, on the server, split the string on the commas back into an array.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...