title: Uncaught TypeError: Cannot call method 'getMonth' of null with dijit.form.DateTextBox
body: <p>I have a grid and an editor for editing each row values. In my editor, i have a this dijit.form.DateTextBox. I also have submit and cancel button.
  On Edit button click, I open the grid popup editor, which has 1 form and bunch of other dojo controls including text box. Now I want to use the cancel button to Reset the form and hide the Dojo Grid Popup Dialog. I created a function for the same. It works fine when i remove the JavaScript which runs after DateTextBox onChange event. 
  It gives me this below error.</p>
  
  <p>Uncaught TypeError: Cannot call method 'getMonth' of null</p>
  
  <p>The JavaScript I have on DateTextBox onChange event is this.</p>
  
  <pre><code>dojo.connect(dijit.byId("Edit_TrialStartDate"), "onChange", function () {                        
                          var item = dojo.date.locale.format(dijit.byId("Edit_TrialStartDate").value, { datePattern: "MM/dd/yyyy", selector: "date" });
                          dijit.byId("Edit_tTrialStartDate").setValue(item);
                      });
  </code></pre>
  
  <p>Because if this error, my grid popup dialog never releases the ID it is registered with. So I can only edit 1 record at a time. When I click on another row Edit button I get this below error.</p>
  
  <p>Uncaught Error: Tried to register widget with id==TrialGridPopUp but that id is already registered</p>
  
  <p>Does anyone have any idea how to resolve this?</p>