Thanks for the example, but what I am looking for is how to pass the
POST data from the receiving file to Ajax.Reqest. So not sure I can
serialize form data on the receiving side.
The serialize function does work great when on the sending page with
the FORM but I am not sure I can use it for this case.
Just to clarify...
On Page 1 I have a form with data... By default the page passes data
to itself and with data it recognizes to do something different (I am
messing with posting.php in phpbb3)... I modify the form action to go
to another php file... Page 2 (which is my components php file)...
mainly so I can post process the html before showing the user.
Page 2 processes some data a bit then needs to pass the POST data
along to the next page (which in this case happens to be Page 1
again)... So on Page 2 I read some of the GET variables to know how to
process the data... just happens that Page 1 sent along POST data as
well... So I need Page 2 to read the POST data it got from Page 1...
Then after processing other data I need Page 2 to pass the post data
back thru the Ajax.Request function which is loading Page 1 again in a
DIV. Somewhat complicated...
Since I am processing this data with PHP I have access to the PHP
$_POST variable as well as the Javascript access to the POST
variables.
On Nov 28, 1:06 pm, Elden
<willy...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:> ****HTML****
>
> <form action="#" method="post"
onsubmit="loadInfo(this);return false"
> id="form_data">
> Name: <input type="text" name="name" />
> Last Name: <input type="text"
name="lastname" />
> <input type="submit" value="submit" />
> </form>
> <div id="data"></div>
>
> ****JAVASCRIPT****
> function loadInfo(form){
> new Ajax.Request(''ajax.php'', {
> parameters: $("form_data").serialize(),
> onSuccess: function(req){
> $("data").update(req.responseText);
> }
> });
>
> }
>
> On Nov 28, 2007 12:39 PM, geeffland
<g...-LiOAg+P8pV4X2WXlbB3fKg@public.gmane.org> wrote:
>
>
>
> > New to the group, and not sure I have the searching figured out yet so
> > let me know if this is already posted somewhere.
>
> > I am writing a Joomla Component that is loading phpbb (a forum) inside
> > a div of Joomla to avoid using IFRAMES. So in short I am using the
> > Ajax.Request call to read in the HTML then I parse thru and using gsub
> > change the default forum links so they pass thru this component
>
> > I have run into a case where I need one php file to receive the post
> > variables then pass them along to an Ajax.Request call which will in
> > turn call the forum''s desired php file to be included in a
DIV...
>
> > Short of decoding the $_POST variables and re-serializing them
> > manually what is the best way to directly pass the then current POST
> > variables directly to the Ajax.Request object call? Is there a way to
> > pass the $_POST array directly?
>
> > Thanks,
> > Greg
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---