How to send array values in a $.get call via jquery? -


let's have multiple text boxes array names, like:

<input type='text' name='test[]' class='test_tb' id='test1' value=''/> <input type='text' name='test[]' class='test_tb' id='test2' value=''/> 

now if using form, serialize , send it, want know how build manually. tried like

$.get('test.php',{    'test[]':$("#test1").val(),    'test[]':$("#test2").val() },function(d){    console.log(d); }); 

but since object can't have repeating keys, didn't work...so manual way of doing this?

ps: learning purpose not actual task.

try

$.get('test.php',{    'test[]':[$("#test1").val(), $("#test2").val()] },function(d){    console.log(d); }); 

Comments

Popular posts from this blog

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -