Hi All , How to convert Serialized form data to JSON formt using prototype.js framework ... Please help me in this regards, Thanks in advance , -- Trinath S --~--~---------~--~----~------------~-------~--~----~ 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, I haven''t needed to do it, but looking at the docs, at first glance I''m thinking: var jsonString = $(''formId'').serialize(true).toJSON(); Details: http://www.prototypejs.org/api/form/serialize http://www.prototypejs.org/api/hash/tojson Hope this helps, -- T.J. Crowder tj / crowder software / com On May 26, 11:32 am, Trinath Somanchi <trinath.soman...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi All , > > How to convert Serialized form data to JSON formt using prototype.js > framework ... > > Please help me in this regards, > > Thanks in advance , > > -- > Trinath S--~--~---------~--~----~------------~-------~--~----~ 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 , thank you for the reply .. How to convert the serialized form data to ans xml format ... some thing like <form_id> <name>data</name> <address>adasds</address> </form_id> I want to know using prototype how I can do this .. please suggest me the ways to this approach. On Mon, May 26, 2008 at 4:22 PM, T.J. Crowder <tjcrowder-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > Hi, > > I haven''t needed to do it, but looking at the docs, at first glance > I''m thinking: > > var jsonString = $(''formId'').serialize(true).toJSON(); > > Details: > http://www.prototypejs.org/api/form/serialize > http://www.prototypejs.org/api/hash/tojson > > Hope this helps, > -- > T.J. Crowder > tj / crowder software / com > > On May 26, 11:32 am, Trinath Somanchi <trinath.soman...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > wrote: > > Hi All , > > > > How to convert Serialized form data to JSON formt using prototype.js > > framework ... > > > > Please help me in this regards, > > > > Thanks in advance , > > > > -- > > Trinath S > > >-- Regards, ---------------------------------------------- Trinath Somanchi, --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Where xml node names/attributes are mapped to what? - kangax On May 27, 7:28 am, "Trinath Somanchi" <trinath.soman...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi , > > thank you for the reply .. > > How to convert the serialized form data to ans xml format ... > > some thing like > > <form_id> > <name>data</name> > <address>adasds</address> > </form_id> > > I want to know using prototype how I can do this .. > > please suggest me the ways to this approach. > > > > On Mon, May 26, 2008 at 4:22 PM, T.J. Crowder <tjcrow...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > Hi, > > > I haven''t needed to do it, but looking at the docs, at first glance > > I''m thinking: > > > var jsonString = $(''formId'').serialize(true).toJSON(); > > > Details: > >http://www.prototypejs.org/api/form/serialize > >http://www.prototypejs.org/api/hash/tojson > > > Hope this helps, > > -- > > T.J. Crowder > > tj / crowder software / com > > > On May 26, 11:32 am, Trinath Somanchi <trinath.soman...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > > wrote: > > > Hi All , > > > > How to convert Serialized form data to JSON formt using prototype.js > > > framework ... > > > > Please help me in this regards, > > > > Thanks in advance , > > > > -- > > > Trinath S > > -- > Regards, > ---------------------------------------------- > Trinath Somanchi,--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
the is the form <form id="form_id"> <input type=text id=name name=name /> <input type=text id=address name=address /> </form> On Tue, May 27, 2008 at 6:36 PM, kangax <kangax-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > Where xml node names/attributes are mapped to what? > > - kangax > > On May 27, 7:28 am, "Trinath Somanchi" <trinath.soman...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > wrote: > > Hi , > > > > thank you for the reply .. > > > > How to convert the serialized form data to ans xml format ... > > > > some thing like > > > > <form_id> > > <name>data</name> > > <address>adasds</address> > > </form_id> > > > > I want to know using prototype how I can do this .. > > > > please suggest me the ways to this approach. > > > > > > > > On Mon, May 26, 2008 at 4:22 PM, T.J. Crowder <tjcrow...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > wrote: > > > > > Hi, > > > > > I haven''t needed to do it, but looking at the docs, at first glance > > > I''m thinking: > > > > > var jsonString = $(''formId'').serialize(true).toJSON(); > > > > > Details: > > >http://www.prototypejs.org/api/form/serialize > > >http://www.prototypejs.org/api/hash/tojson > > > > > Hope this helps, > > > -- > > > T.J. Crowder > > > tj / crowder software / com > > > > > On May 26, 11:32 am, Trinath Somanchi <trinath.soman...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > > > wrote: > > > > Hi All , > > > > > > How to convert Serialized form data to JSON formt using prototype.js > > > > framework ... > > > > > > Please help me in this regards, > > > > > > Thanks in advance , > > > > > > -- > > > > Trinath S > > > > -- > > Regards, > > ---------------------------------------------- > > Trinath Somanchi, > > >-- Regards, ---------------------------------------------- Trinath Somanchi, --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
> How to convert the serialized form data to ans xml format ...Don''t take this the wrong way, but once you have the Hash object from Form.serialize(true), isn''t this trivial? -- T.J. Crowder tj / crowder software / com On May 27, 3:27 pm, "Trinath Somanchi" <trinath.soman...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> the is the form > > <form id="form_id"> > <input type=text id=name name=name /> > <input type=text id=address name=address /> > </form> > > > > On Tue, May 27, 2008 at 6:36 PM, kangax <kan...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > Where xml node names/attributes are mapped to what? > > > - kangax > > > On May 27, 7:28 am, "Trinath Somanchi" <trinath.soman...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > > wrote: > > > Hi , > > > > thank you for the reply .. > > > > How to convert the serialized form data to ans xml format ... > > > > some thing like > > > > <form_id> > > > <name>data</name> > > > <address>adasds</address> > > > </form_id> > > > > I want to know using prototype how I can do this .. > > > > please suggest me the ways to this approach. > > > > On Mon, May 26, 2008 at 4:22 PM, T.J. Crowder <tjcrow...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > > wrote: > > > > > Hi, > > > > > I haven''t needed to do it, but looking at the docs, at first glance > > > > I''m thinking: > > > > > var jsonString = $(''formId'').serialize(true).toJSON(); > > > > > Details: > > > >http://www.prototypejs.org/api/form/serialize > > > >http://www.prototypejs.org/api/hash/tojson > > > > > Hope this helps, > > > > -- > > > > T.J. Crowder > > > > tj / crowder software / com > > > > > On May 26, 11:32 am, Trinath Somanchi <trinath.soman...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > > > > wrote: > > > > > Hi All , > > > > > > How to convert Serialized form data to JSON formt using prototype.js > > > > > framework ... > > > > > > Please help me in this regards, > > > > > > Thanks in advance , > > > > > > -- > > > > > Trinath S > > > > -- > > > Regards, > > > ---------------------------------------------- > > > Trinath Somanchi, > > -- > Regards, > ---------------------------------------------- > Trinath Somanchi,--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
it not trivial but the spec has this requirement On Wed, May 28, 2008 at 5:01 PM, T.J. Crowder <tjcrowder-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > How to convert the serialized form data to ans xml format ... > > Don''t take this the wrong way, but once you have the Hash object from > Form.serialize(true), isn''t this trivial? > -- > T.J. Crowder > tj / crowder software / com > > On May 27, 3:27 pm, "Trinath Somanchi" <trinath.soman...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > wrote: > > the is the form > > > > <form id="form_id"> > > <input type=text id=name name=name /> > > <input type=text id=address name=address /> > > </form> > > > > > > > > On Tue, May 27, 2008 at 6:36 PM, kangax <kan...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > Where xml node names/attributes are mapped to what? > > > > > - kangax > > > > > On May 27, 7:28 am, "Trinath Somanchi" <trinath.soman...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > > > wrote: > > > > Hi , > > > > > > thank you for the reply .. > > > > > > How to convert the serialized form data to ans xml format ... > > > > > > some thing like > > > > > > <form_id> > > > > <name>data</name> > > > > <address>adasds</address> > > > > </form_id> > > > > > > I want to know using prototype how I can do this .. > > > > > > please suggest me the ways to this approach. > > > > > > On Mon, May 26, 2008 at 4:22 PM, T.J. Crowder <tjcrow...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > > > wrote: > > > > > > > Hi, > > > > > > > I haven''t needed to do it, but looking at the docs, at first glance > > > > > I''m thinking: > > > > > > > var jsonString = $(''formId'').serialize(true).toJSON(); > > > > > > > Details: > > > > >http://www.prototypejs.org/api/form/serialize > > > > >http://www.prototypejs.org/api/hash/tojson > > > > > > > Hope this helps, > > > > > -- > > > > > T.J. Crowder > > > > > tj / crowder software / com > > > > > > > On May 26, 11:32 am, Trinath Somanchi <trinath.soman...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > > > > > wrote: > > > > > > Hi All , > > > > > > > > How to convert Serialized form data to JSON formt using > prototype.js > > > > > > framework ... > > > > > > > > Please help me in this regards, > > > > > > > > Thanks in advance , > > > > > > > > -- > > > > > > Trinath S > > > > > > -- > > > > Regards, > > > > ---------------------------------------------- > > > > Trinath Somanchi, > > > > -- > > Regards, > > ---------------------------------------------- > > Trinath Somanchi, > > >-- Regards, ---------------------------------------------- Trinath Somanchi, --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
> it not trivial but the spec has this requirementNo, I meant: Surely creating the xml from a Hash object is a trivial exercise? I mean, off the top of my head: var propName; var hash; var xml; var formid; formid = "(whatever your form ID is)"; xml = "<" + formid + ">"; hash = $(formid).serialize(true); for (propName in hash) { if (typeof hash[propName] != "function") { xml += "<" + propName + ">" + hash[propName] + "</" + propName + ">"; } } xml += "</" + formid + ">"; That''s not tested code, and you''ll need to do XML escapes on the values where I''ve just used the raw value (Prototype''s String#escapeHTML may help there), but my point/question was, I''m not seeing what the complication is? -- T.J. Crowder tj / crowder software / com On May 28, 2:11 pm, "Trinath Somanchi" <trinath.soman...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> it not trivial but the spec has this requirement > > > > On Wed, May 28, 2008 at 5:01 PM, T.J. Crowder <tjcrow...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > How to convert the serialized form data to ans xml format ... > > > Don''t take this the wrong way, but once you have the Hash object from > > Form.serialize(true), isn''t this trivial? > > -- > > T.J. Crowder > > tj / crowder software / com > > > On May 27, 3:27 pm, "Trinath Somanchi" <trinath.soman...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > > wrote: > > > the is the form > > > > <form id="form_id"> > > > <input type=text id=name name=name /> > > > <input type=text id=address name=address /> > > > </form> > > > > On Tue, May 27, 2008 at 6:36 PM, kangax <kan...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > Where xml node names/attributes are mapped to what? > > > > > - kangax > > > > > On May 27, 7:28 am, "Trinath Somanchi" <trinath.soman...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > > > > wrote: > > > > > Hi , > > > > > > thank you for the reply .. > > > > > > How to convert the serialized form data to ans xml format ... > > > > > > some thing like > > > > > > <form_id> > > > > > <name>data</name> > > > > > <address>adasds</address> > > > > > </form_id> > > > > > > I want to know using prototype how I can do this .. > > > > > > please suggest me the ways to this approach. > > > > > > On Mon, May 26, 2008 at 4:22 PM, T.J. Crowder <tjcrow...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > > > > wrote: > > > > > > > Hi, > > > > > > > I haven''t needed to do it, but looking at the docs, at first glance > > > > > > I''m thinking: > > > > > > > var jsonString = $(''formId'').serialize(true).toJSON(); > > > > > > > Details: > > > > > >http://www.prototypejs.org/api/form/serialize > > > > > >http://www.prototypejs.org/api/hash/tojson > > > > > > > Hope this helps, > > > > > > -- > > > > > > T.J. Crowder > > > > > > tj / crowder software / com > > > > > > > On May 26, 11:32 am, Trinath Somanchi <trinath.soman...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > > > > > > wrote: > > > > > > > Hi All , > > > > > > > > How to convert Serialized form data to JSON formt using > > prototype.js > > > > > > > framework ... > > > > > > > > Please help me in this regards, > > > > > > > > Thanks in advance , > > > > > > > > -- > > > > > > > Trinath S > > > > > > -- > > > > > Regards, > > > > > ---------------------------------------------- > > > > > Trinath Somanchi, > > > > -- > > > Regards, > > > ---------------------------------------------- > > > Trinath Somanchi, > > -- > Regards, > ---------------------------------------------- > Trinath Somanchi,--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---