How can I change the format of the value submitted for a DateTextBox. The default format appears to be yyyy-MM-dd. I would like it to be MM/dd/yyyy.
DateTextBox Format Submitted Value
Submitted by john.pfeifer@hn... on Tue, 04/15/2008 - 00:04.
- Login or register to post comments
- Subscribe post

See the dojo book page on
See the dojo book page on the Dijit form widgets, specifically the section on sending and receiving data from the server. The ISO format is chosen deliberately as a good programming practice, but it is possible to override the behavior.
I have the following Date
[EDIT: fixed the formatting so that you actually see the code you posted.]
I have the following Date field. The docs lead me to believe that the datePattern will be used when submitting the form but that isn't the case. I still see the yyyy-MM-dd as the value submitted to the server.
Any ideas would be greatly appreciated.
datePattern is for display value only (UI)
The docs should not imply anything about datePattern having any impact on the submitted value. Please point to the docs and we'll make the correction.
There are two different dates - the one you see and the one that's submitted to the server. The latter is not easily customizable, by design, though it is possible to override. Please read the link posted above.
Try adding...
...this:
(EDITED)
IIRC the constraints object is used for validation purposes and not for formatting.
I see this on the server side
Called TestServlet
param initiativeRequestBackgroundInformation.expectedResults has value asdf
param initiativeRequestBackgroundInformation.effectiveDateOfChange has value 2005-05-22
param initiativeRequestBackgroundInformation.descriptionOfBusinessAreasImpacted has value adsfadsf
param initiativeRequestBackgroundInformation.descriptionOfChangeRequested has value adsfadsf
param initiativeRequestBackgroundInformation.initiativeRequestId has value 2
param initiativeRequestBackgroundInformation.businessNeed has value asdfasdf
param has value 05/22/2005
Looks like an additional input field is created without a name. I was able to confirm using firebug. I see the following in the html.
<input type="text" value="" style="display: none;" name="initiativeRequestBackgroundInformation.effectiveDateOfChange"/>
Am I missing something?
Figured it out...
The link above to Sending and Receing Server formats has a great example. Take a look at the OracleDateTextBox. Does exactly what I want.