You can use the formContents combined with the queryString function to
build a query string. This example then uses a POST request to send
the data to the server, as opposed to a GET, which is much easier.

                function saveForm()
                {
                        frm = MochiKit.DOM.getElement('myFormId');
                        var formValuesArray= MochiKit.DOM.formContents(frm);
                        var queryString =
MochiKit.Base.queryString(formValuesArray[0],formValuesArray[1]);

                        var req = getXMLHttpRequest();
                        req.open( "POST", "FormData.aspx", true);
                        req.setRequestHeader('Content-Type', 
'application/x-www-form-
urlencoded');
                        var d = 
MochiKit.Async.sendXMLHttpRequest(req,queryString);
                        d.addCallbacks(gotMetadata,gotMetadataf);
                }

                function gotMetadata(req)
                {
                        log('success');
                }
                function gotMetadataf(req)
                {
                        log('failed');
                }


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"MochiKit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/mochikit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to