David
David

Reputation: 75

How do I submit data with Dojo DateTextBox after selecting a date

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?

Upvotes: 0

Views: 1669

Answers (2)

Doug
Doug

Reputation:

This is fixed in Dojo 1.4. Refer to ticket #9566.

Upvotes: 1

Lawrence Barsanti
Lawrence Barsanti

Reputation: 33232

Change dojo.byId('timespan').submit(); to dijit.byId('timespan').submit();

For an explanation read this.

Upvotes: 0

Related Questions