On Dec 19, 2006, at 12:35 AM, iain duncan wrote:
>
> If someone has the time to type out the an example that would be
> awesome.
Here it goes:
function submit_form(form) {
// return the defered returned by loadJSONDoc when submitting
// form asyncronously
var query = Array();
var contents = formContents(form);
for (var j=0; j<contents[0].length; j++)
query[contents[0][j]] = contents[1][j];
query["tg_random"] = new Date().getTime();
var url_w_query = from.action + '?' + queryString(query);
log(effective_url);
return loadJSONDoc(url_w_query)
}
queryString and formContents are MochiKit's functions.
to use:
submit_form("my_forms_id").addCallback(form_submited).addErrback
(submission_failed)
HTH,
Alberto
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"TurboGears" 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/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---