itsmegawtf-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2007-Oct-22 16:02 UTC
Problem with passing an js-array to Ajax.Updater
Hello, I have an array like:
ids = new Array(1, 2, 3);
function myFunc() {
new Ajax.Updater(''place'', ''script.php'',
{
method: ''post'',
parameters: {
toPost: ids
}
});
}
As you can see, I have an php handler (script.php)
it contains var_dump($_POST);
In result I am getting just last array value, not the whole array, any
way to solve my problem?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Spinoffs" group.
To post to this group, send email to
rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---
if this is your baby-steps way of getting to a form submission via ajax, just jump into the water -- it''s not hard, and honestly a lot easier... because you''ll have access to form.serialize but if this is really what you want to do then maybe look at http://prototypejs.org/api/hash/toQueryString BUT: if you are only doing it as I stated above - a testing the waters kind of thing, then just jump right in. look at: http://prototypejs.org/api/form/serialize On 10/22/07, itsmegawtf-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org <itsmegawtf-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > Hello, I have an array like: > > ids = new Array(1, 2, 3); > > function myFunc() { > new Ajax.Updater(''place'', ''script.php'', { > method: ''post'', > parameters: { > toPost: ids > } > }); > } > > As you can see, I have an php handler (script.php) > it contains var_dump($_POST); > > In result I am getting just last array value, not the whole array, any > way to solve my problem? > > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---