Wednesday, 15 August 2012

javascript - submitting php array via ajax not working -


I have this code for my Ajax:

  function set list (str) {Var postDatas = decoder ($ ('# form' + str + ''). Serialize ()); Warnings (postDatas); // $ ('# crm-feedback'). Html ('& lt; img src = "images / ajax-loader.gif" />'); $ .ajax ($ url: 'somewhere / setmail.fp', type: 'post', // datatype: "jason", data: postdates, success: work (data) {// $ ('# crm-feedback '). HTML (' save! '). CSS (' color ',' green '); warning ("test");}}); }   

PostData is the value "email_id [] = 1 and email_ id [] = 2 & test = asd"

In my form I have a multiple selection in which there is an array for its name, name = "email_id []" .

Now my problem is that I feel that my AJAX get a request to be successful, and I am unable to understand the reason for this problem lies.

I set up a few sessions in setEmail.php so that I can see that the AJAX request was submitted.

? & Gt;

None of the PS sessions are being set

thanks

I found the project that I am working on:

In HTML:

  & lt; Input type = "text" name = "[add id_item]" />   

In php:

  $ _ POST ["add"] ["id_item"]   

I think You need to treat the variable as an array. Perhaps this gives you some ideas where to go, try $ _ POST ['email_id'] [0] and see what you get.

No comments:

Post a Comment