title: Dojo dialog - how to save contents of dialog
body: <p>I am new to dojo and I have been following the tutorials mentioned here
  <a href="http://dojotoolkit.org/reference-guide/1.7/dijit/Dialog.html" rel="nofollow">http://dojotoolkit.org/reference-guide/1.7/dijit/Dialog.html</a></p>
  
  <p>I am not sure how to capture the data entered in dialog</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
   require(["dojo/ready", "dijit/Dialog", "dijit/form/Button"], 
  
    function(ready, Dialog, Button){
      ready(function(){
          var myDialog = new Dialog({
              title: "Add",
              style: "width: 600px"
          });
  
          var myButton = new Button({
              onClick: function(){
                  myDialog.set("content", getDialog());
                  myDialog.show();
              }
          }, "progbutton");
      });
  });
  
  function getDialog(){
    return document.getElementById('add-link-dialog-container').innerHTML;
  }
  
  
  &lt;/script&gt;
  </code></pre>
  
  <p>Html:</p>
  
  <pre><code>  &lt;div id="add-link-dialog-container" style="display:none;"&gt; 
          &lt;div&gt;
             &lt;table class="dijitDialogPaneContentArea"&gt;
               &lt;tr&gt;
                &lt;td&gt;&lt;label for="name"&gt;Name:&lt;/label&gt;&lt;/td&gt;
                &lt;td&gt;&lt;input data-dojo-type="dijit/form/TextBox" name="name" id="name" value="Test"/&gt;&lt;/td&gt;
               &lt;/tr&gt;
               &lt;tr&gt;
                 &lt;td&gt;&lt;label for="address"&gt;Address:&lt;/label&gt;&lt;/td&gt;
                 &lt;td&gt;&lt;input data-dojo-type="dijit/form/TextBox" name="address" id="address"/&gt;&lt;/td&gt;
               &lt;/tr&gt;
              &lt;/table&gt;
  
             &lt;div class="dijitDialogPaneActionBar"&gt;
                 &lt;button dojoType="dijit.form.Button" type="submit" id="ok"&gt;Add&lt;/button&gt;
                 &lt;button dojoType="dijit.form.Button" type="button" id="cancel"&gt;Cancel&lt;/button&gt;
             &lt;/div&gt;
           &lt;/div&gt; 
         &lt;/div&gt;
         &lt;button id="progbutton" type="button"&gt;Add New&lt;/button&gt;
  </code></pre>
  
  <p>The dialog does pop up. But how do I capture the data entered in the fields?
  Is there any better way to do this?</p>