I'm trying to make a DateTextBox that submits data once a date is selected. To do that I have this code: <form action="timecard/setViewDate" method="post" id="timespan" dojoType="dijit.form.Form">
<input type="text" name="calendar" value="2009-09-28" id="calendar" dojoType="dijit.form.DateTextBox" onchange="doTimechangeSubmit" />
</form>
and the onchange function is: function doTimechangeSubmit()
{
var thisdialog = new dijit.Dialog({ title: "Please Wait...", content: "We are wasting some time.", id: 'stupidWasteOfTime'});
dojo.body().appendChild(thisdialog.domNode);
thisdialog.startup();
thisdialog.show();
setTimeout("dojo.byId('timespan').submit();",1000);
dojo.byId('timespan').submit();
}
I have this function because without waiting a bit the value I receive is the date the widget starts with. I hate this and I'm just waiting for a slow response to break it.
My want is to hook the submit function in a place that guarantees I get the value the user actually selected. Anybody have any ideas?