ajax sync post script problem

Can you please tell me if the following syntax is correct for an ajax post with sync that returns the response in a field named “text”?

[code]function saveTask() {
var saveTaskURL = “http://pz.southware.com/cgi-nl/NLNET15.BAT”;
var text="";
dhx.ajax().sync().post(saveTaskURL, $$(‘taskform’).getValues(), function(text, xml, xhr){
alert("text: "+text); //debug
if (text.substr(0,2) == “OK”) {
$$(‘taskform’).save();
alert(“Task Saved”); //debug
showGrid();
};
});

    };

[/code]
The ajax post runs correctly - I can see in Firebug that the script ran properly and the server returned the correct response. But the alert doesn’t display and the remaining part of the script doesn’t run, although the browser doesn’t give any errors. Can you tell me why the script doesn’t continue past the ajax call?

Thanks.

sync request do not need callback ( probably we will add compatibility with async mode syntax in next update )

var xhr = dhx.ajax().sync().post(saveTaskURL, $$('taskform').getValues());
text = xhr.responseText;
if (text.substr(0,2) == "OK") {
	$$('taskform').save();
	alert("Task Saved");  //debug
	showGrid();
};

Thank you.

When I submit the form using getValues my date field shows the full date even though the format of the field is %m/%d/%y. Can I format the date being sent via getValues (I want the date sent via the post string to be %m/%d/%y)?

I fixed it. I added stringResult: true to the datepicker element and that fixed the data for submission. Thanks.