I have some ideas how to go about this, but wanted to see if people already had solutions in place for this. The basic scenario is i''m sending form data over ajax using form.serialize to send the form data (as per the standard methodology). However, on some pages i have very large forms (few thousand form fields - its a simulated editable grid), and I only want to send the data in the form fields that the user has changed. Are there any built in functions to specify filter rules to form.serialize? My initial approach is to have a 2nd empty form tag on the page, and whenever the user changes a form field it will call a function that will dynamically create a new hidden form element in the 2nd form and write the attribute name and value into the hidden field. Then serialize this 2nd hidden ''data'' form. That seems like it would work ok, but i was wondering if other people had more elegant solutions already? -- Posted via http://www.ruby-forum.com/.
Martin Bialasinski
2006-Apr-19 15:15 UTC
Re: Form.Serialize - Method''s for limiting form data?
On 4/17/06, Erin Brewer <erin-A+eRycXGxsFBDgjK7y7TUQ@public.gmane.org> wrote:> My initial approach is to have a 2nd empty form tag on the page, and > whenever the user changes a form field it will call a function that will > dynamically create a new hidden form element in the 2nd form and write > the attribute name and value into the hidden field. Then serialize this > 2nd hidden ''data'' form.Performancewise, this should be the best thing. You could refine it to hold the data in an Object and then convert the Object to a string and transfer this string. Saves you hitting the DOM. You could also compare .value to .defaultValue of a input field and remove the field from the holding Object, if the user reverts the data to the initial value. Bye, Martin
Reasonably Related Threads
- Prototype Ajax - How to pass my own params to onComplete ?
- RE: Re: Prototype Ajax - How to pass my own params toonComplete
- Form.serialize(this) returning empty string in onSubmit, Ajax.Update context, works in Firebug watch
- problems with migrations in sql server
- Problem with Prototype 1.6.0.2, Opera 9 and Form.serialize()