Running the following code:
dojo.toJson(formSearch.attr("value"));
Appears to not serialize the value of dijit.form.DateTextBox controls. Looking in Firebug, I can see that formSearch.attr("value")) returns the appropriate DOM object that contains the value that the control is set to, but when I try to serialize it, I get something like:
{"startDate":{}}
The
valueattribute of adijit.form.DateTextBoxis of type Date. This is useful to manipulate Dates from JavaScript, but by default there is no serializer for Dates to JSON. If you wish to get the value of the widget for serialization, usedijit.form.DateTextBox.serialize(), which will give you the value as a string.If you use the
DateTextBoxin a or adijit.form.Form, the serialization should happen for you on submit.