PDA

View Full Version : flex equivalent of form.serialize


lectrospin
07-23-2009, 10:07 PM
is there a flex equivalent of form.serialize in javascript or any alternative way to loop through inputs in a form?

Peter Cowling
07-24-2009, 05:38 PM
There is no quick/built-in way to serialize form data in the sort of way that form.serialize does that I know.

Capturing inputs as they are committed and creating elements that could be joined into a string would be my approach. I would create the string elements, validate that all required elements are in place, and then create the required string. Something along those lines, anyhow.

lectrospin
07-25-2009, 12:43 AM
Not sure exactly what you mean. It's pretty disappointing that there isn't a way to easily get a form's input. I suppose you coulds go through all a forms children looking for inputs.

Peter Cowling
07-25-2009, 05:10 PM
It's pretty disappointing that there isn't a way to easily get a form's input. I suppose you coulds go through all a forms children looking for inputs.

The best way to catch a forms input is to catch it as the user finishes entering in the information. This is a commit event in text input or a dropdown event or something like that. If you capture the information at that point, validate it, or do whatever else you need to do with it, then it will be ready for when the user want to submit that information.