AJAX call to submit form to custom handler

I’m trying to understand how to submit a form to my custom server handler with Touch. I see the example to bind a grid with a form and a form with a dataprocessor, but I don’t know how to access the text returned from the AJAX call.

What is the syntax to submit a form via AJAX (sync mode) and receive the resulting string back as text?

I did the following function to update a form field via AJAX:
dhx.ajax(getTextURL, function(gotText, xml, XmlHttpRequest){
$$(‘taskform’).setValues({
Textarea: gotText
});
});

But I don’t know how to send the form variables from “taskform” via this method, so I’m assuming some other syntax is required.

Thanks for your help.

Code like next can be used

dhx.ajax().post(“data.php”, $$(‘taskform’).getValues());

Thanks. If I submit the form with this syntax, how do I reference the response text from the AJAX call? My server program returns an “OK” as a string if the update is successful. I need to test it to verify that the form update was successful.

Last parameter - callback

dhx.ajax().post("data.php", $$('taskform').getValues(), function(text, xml, xhr){ if (text == "OK") dhx.notice("Well done!"); });