Dan
Dan

Reputation: 11

Dialog DateTextBox returns empty value

I'm using DateTextBox in a Dialog, and I was surprised to see that after selecting a date, the dialog returns an empty value once submitted. Even more surprising is the fact that it's broken in the Dojo demos themselves: http://dojocampus.org/explorer/#Dijit_Dialog_Basic - enter a date, click OK, and see the returned value for the date.

Am I missing something? Any ideas how to get the right value from the dialog?

Thanks,

Dan

Upvotes: 1

Views: 176

Answers (1)

peller
peller

Reputation: 4543

Looks like the demo is bogus. The value attribute of the widget in Javascript is a Date object, which cannot be serialized with dojo.toJson.

dojo.toJson(new Date())
"{}"

How are you inspecting the return value? If submitting an HTML form, two values should be submitted - one with the NAME attribute matching your declared DateTextBox element which should have an RFC3339-ish date, and another which represents the visual field but is not serialized with the given NAME attribute.

Upvotes: 1

Related Questions