Send a array with Jquery Ajax

boltubm418

New Member
Trying to send an array from:\[code\]<select name='galaddvenn[]' class='sel_add vl hidden' multiple='multiple'><option value='http://stackoverflow.com/questions/3696548/53'>name1</option><option value='http://stackoverflow.com/questions/3696548/352'>name2</option><option value='http://stackoverflow.com/questions/3696548/632'>name3</option><option value='http://stackoverflow.com/questions/3696548/543'>name4</option>..etc</select>\[/code\]...to/from Jquery with:\[code\]var ar = $("select#galaddvenn").serialize(); j.ajax({ data: ({ar : ar}), //tried with 'ar':ar dataType: "html", type:"post", url: "/ajax_gal_addvenn.php", cache: false,\[/code\]....etcto PHP:\[code\]if(isset($_POST['ar'])){$ar = mysql_real_escape_string($_POST['ar']);var_dump($ar);\[/code\]Gives me: bool(false) :( What am i doing wrong here?
 
Back
Top