Hi there, i''ve been browsing the net for tutorials on using prototype 1.6. I am using it to change most of my ajax scripts as they have browser incompatibility issues. I am looking for a format on how to set the Ajax.Updater method to post, and where and how would i do this, do i have to first serialize the form values? What if i am not using a form for these values, what if i just want to make the post array myself like: msg = "txCName=" + escape(cname) + "&"; msg += "txNature=" + escape(nature) + "&"; msg += "txSector=" + escape(sector) + "&"; msg += "txDate=" + escape(dates) + "&"; msg += "txEmployees=" + escape(numempl) + "&"; msg += "txMail=" + escape(mail) + "&"; and then post the msg string? please help --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Hi, Check out the ''parameters'' member of the Ajax options: http://www.prototypejs.org/api/ajax/options Hope this helps, -- T.J. Crowder tj / crowder software / com On Apr 2, 12:27 pm, r-it <sol...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi there, i''ve been browsing the net for tutorials on using prototype > 1.6. I am using it to change most of my ajax scripts as they have > browser incompatibility issues. I am looking for a format on how to > set the Ajax.Updater method to post, and where and how would i do > this, do i have to first serialize the form values? What if i am not > using a form for these values, what if i just want to make the post > array myself like: > > msg = "txCName=" + escape(cname) + "&"; > msg += "txNature=" + escape(nature) + "&"; > msg += "txSector=" + escape(sector) + "&"; > msg += "txDate=" + escape(dates) + "&"; > msg += "txEmployees=" + escape(numempl) + "&"; > msg += "txMail=" + escape(mail) + "&"; > > and then post the msg string? > > please help--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
I saw that already but i just wanted to know/see the Ajax.Updater format at work using post with many values, if you know what i mean. Thanks. On Apr 2, 2:13 pm, "T.J. Crowder" <tjcrow...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi, > > Check out the ''parameters'' member of the Ajax options:http://www.prototypejs.org/api/ajax/options > > Hope this helps, > -- > T.J. Crowder > tj / crowder software / com > > On Apr 2, 12:27 pm, r-it <sol...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > Hi there, i''ve been browsing the net for tutorials on using prototype > > 1.6. I am using it to change most of my ajax scripts as they have > > browser incompatibility issues. I am looking for a format on how to > > set the Ajax.Updater method to post, and where and how would i do > > this, do i have to first serialize the form values? What if i am not > > using a form for these values, what if i just want to make the post > > array myself like: > > > msg = "txCName=" + escape(cname) + "&"; > > msg += "txNature=" + escape(nature) + "&"; > > msg += "txSector=" + escape(sector) + "&"; > > msg += "txDate=" + escape(dates) + "&"; > > msg += "txEmployees=" + escape(numempl) + "&"; > > msg += "txMail=" + escape(mail) + "&"; > > > and then post the msg string? > > > please help--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
> I saw that already but i just wanted to know/see the Ajax.Updater > format at work using post with many values, if you know what i mean.That''s what the link tells you (perhaps in combination with the Ajax.Updater page). Perhaps I''m not understanding the question? -- T.J. Crowder tj / crowder software / com On Apr 2, 1:27 pm, r-it <sol...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I saw that already but i just wanted to know/see the Ajax.Updater > format at work using post with many values, if you know what i mean. > > Thanks. > > On Apr 2, 2:13 pm, "T.J. Crowder" <tjcrow...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > Hi, > > > Check out the ''parameters'' member of the Ajax options:http://www.prototypejs.org/api/ajax/options > > > Hope this helps, > > -- > > T.J. Crowder > > tj / crowder software / com > > > On Apr 2, 12:27 pm, r-it <sol...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > Hi there, i''ve been browsing the net for tutorials on using prototype > > > 1.6. I am using it to change most of my ajax scripts as they have > > > browser incompatibility issues. I am looking for a format on how to > > > set the Ajax.Updater method to post, and where and how would i do > > > this, do i have to first serialize the form values? What if i am not > > > using a form for these values, what if i just want to make the post > > > array myself like: > > > > msg = "txCName=" + escape(cname) + "&"; > > > msg += "txNature=" + escape(nature) + "&"; > > > msg += "txSector=" + escape(sector) + "&"; > > > msg += "txDate=" + escape(dates) + "&"; > > > msg += "txEmployees=" + escape(numempl) + "&"; > > > msg += "txMail=" + escape(mail) + "&"; > > > > and then post the msg string? > > > > please help--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
OK, you know using get you have something like this: $(''loader'').innerHTML = "<img src=''ajax-loader.gif'' />"; var url = ''getselect.php''; var pars = "type=" + type; new Ajax.Updater(''loader'', url, { method: ''get'', parameters: pars, }); what would be the equivalent using POST method, would you just need to replace the ''get'' with post, or do you have to use a serialized form array variable? can i not use something like this: msg = "txCName=" + escape(cname) + "&"; msg += "txNature=" + escape(nature) + "&"; msg += "txSector=" + escape(sector) + "&"; msg += "txDate=" + escape(dates) + "&"; msg += "txEmployees=" + escape(numempl) + "&"; msg += "txMail=" + escape(mail) + "&"; and pass it to the parameters thing? Sometimes i will not be using forms, i will only want to post the data i want to post, does that give you any clarity? Thanks a lot for the input. On Apr 2, 2:32 pm, "T.J. Crowder" <tjcrow...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > I saw that already but i just wanted to know/see the Ajax.Updater > > format at work using post with many values, if you know what i mean. > > That''s what the link tells you (perhaps in combination with the > Ajax.Updater page). Perhaps I''m not understanding the question? > -- > T.J. Crowder > tj / crowder software / com > > On Apr 2, 1:27 pm, r-it <sol...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > I saw that already but i just wanted to know/see the Ajax.Updater > > format at work using post with many values, if you know what i mean. > > > Thanks. > > > On Apr 2, 2:13 pm, "T.J. Crowder" <tjcrow...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > Hi, > > > > Check out the ''parameters'' member of the Ajax options:http://www.prototypejs.org/api/ajax/options > > > > Hope this helps, > > > -- > > > T.J. Crowder > > > tj / crowder software / com > > > > On Apr 2, 12:27 pm, r-it <sol...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > Hi there, i''ve been browsing the net for tutorials on using prototype > > > > 1.6. I am using it to change most of my ajax scripts as they have > > > > browser incompatibility issues. I am looking for a format on how to > > > > set the Ajax.Updater method to post, and where and how would i do > > > > this, do i have to first serialize the form values? What if i am not > > > > using a form for these values, what if i just want to make the post > > > > array myself like: > > > > > msg = "txCName=" + escape(cname) + "&"; > > > > msg += "txNature=" + escape(nature) + "&"; > > > > msg += "txSector=" + escape(sector) + "&"; > > > > msg += "txDate=" + escape(dates) + "&"; > > > > msg += "txEmployees=" + escape(numempl) + "&"; > > > > msg += "txMail=" + escape(mail) + "&"; > > > > > and then post the msg string? > > > > > please help--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Hi, Just change the name of the method. From ''parameters'' documentation on the Ajax.Options page I linked to (my CAPS): << The parameters for the request, which will be encoded into the URL for a ''get'' method, OR INTO THE REQUEST BODY FOR THE OTHER METHODS. This can be provided either as a URL-encoded string or as any Hash- compatible object (basically anything), with properties representing parameters. >> -- T.J. Crowder tj / crowder software / com On Apr 2, 2:48 pm, r-it <sol...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> OK, you know using get you have something like this: > > $(''loader'').innerHTML = "<img src=''ajax-loader.gif'' />"; > var url = ''getselect.php''; > var pars = "type=" + type; > new Ajax.Updater(''loader'', url, > { > method: ''get'', > parameters: pars, > > }); > > what would be the equivalent using POST method, would you just need to > replace the ''get'' with post, or do you have to use a serialized form > array variable? > can i not use something like this: > msg = "txCName=" + escape(cname) + "&"; > msg += "txNature=" + escape(nature) + "&"; > msg += "txSector=" + escape(sector) + "&"; > msg += "txDate=" + escape(dates) + "&"; > msg += "txEmployees=" + escape(numempl) + "&"; > msg += "txMail=" + escape(mail) + "&"; > > and pass it to the parameters thing? Sometimes i will not be using > forms, i will only want to post the data i want to post, does that > give you any clarity? > > Thanks a lot for the input. > > On Apr 2, 2:32 pm, "T.J. Crowder" <tjcrow...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > I saw that already but i just wanted to know/see the Ajax.Updater > > > format at work using post with many values, if you know what i mean. > > > That''s what the link tells you (perhaps in combination with the > > Ajax.Updater page). Perhaps I''m not understanding the question? > > -- > > T.J. Crowder > > tj / crowder software / com > > > On Apr 2, 1:27 pm, r-it <sol...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > I saw that already but i just wanted to know/see the Ajax.Updater > > > format at work using post with many values, if you know what i mean. > > > > Thanks. > > > > On Apr 2, 2:13 pm, "T.J. Crowder" <tjcrow...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > Hi, > > > > > Check out the ''parameters'' member of the Ajax options:http://www.prototypejs.org/api/ajax/options > > > > > Hope this helps, > > > > -- > > > > T.J. Crowder > > > > tj / crowder software / com > > > > > On Apr 2, 12:27 pm, r-it <sol...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > > Hi there, i''ve been browsing the net for tutorials on using prototype > > > > > 1.6. I am using it to change most of my ajax scripts as they have > > > > > browser incompatibility issues. I am looking for a format on how to > > > > > set the Ajax.Updater method to post, and where and how would i do > > > > > this, do i have to first serialize the form values? What if i am not > > > > > using a form for these values, what if i just want to make the post > > > > > array myself like: > > > > > > msg = "txCName=" + escape(cname) + "&"; > > > > > msg += "txNature=" + escape(nature) + "&"; > > > > > msg += "txSector=" + escape(sector) + "&"; > > > > > msg += "txDate=" + escape(dates) + "&"; > > > > > msg += "txEmployees=" + escape(numempl) + "&"; > > > > > msg += "txMail=" + escape(mail) + "&"; > > > > > > and then post the msg string? > > > > > > please help--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---