title: Values of a form's fields to an Ajax call using Dojo
body: <p>I have a form like this (from a widget template):</p>
  
  <pre><code>   '&lt;div&gt;' +
      '  &lt;form data-dojo-type="dijit.form.Form" data-dojo-attach-point="form" method="POST"&gt; ' +
      '    &lt;label for="${id}_workspace"&gt;Workspace name&lt;/label&gt;  ' +
      '    &lt;input name="workspace" id="${id}_workspace" data-dojo-attach-point="workspace" data-dojo-type="app.ValidationWorkspace" /&gt;' +
      '    &lt;label for="${id}_password1"&gt;Password&lt;/label&gt;  ' +
      '    &lt;input name="password[0]" id="${id}_password1" data-dojo-attach-point="password1" data-dojo-type="app.ValidationPassword" /&gt;' +
      '    &lt;label for="${id}_password1"&gt;Confirm password&lt;/label&gt;  ' +
      '    &lt;input name="password[1]" id="${id}_password2" data-dojo-attach-point="password2" data-dojo-type="app.ValidationPassword" /&gt;' +
      '    &lt;input type="submit" data-dojo-attach-point="button" data-dojo-type="app.BusyButton" label="Create!" /&gt;' +
      '  &lt;/form&gt;' +
      '&lt;/div&gt;',
  </code></pre>
  
  <p>In the code, I wrote:</p>
  
  <pre><code>        data = {};
          data.workspace = that.workspace.get('value');
          data.password = [];
          data.password[0] = that.password1.get('value');
          data.password[1] = that.password2.get('value');
  
          // Store the data 
          g.stores.workspacesAnon.put(data).then(
            function(res){
              console.log("Jsonrest put(data) returned OK: " + json.toJson(res) );
              that.button.cancel();
            }
          );
  </code></pre>
  
  <p>Two actual questions:</p>
  
  <ol>
  <li><p>If I use that.form.value.email instead of  that.password1.get('value'), sometimes outdated values are submitted to the form (!). For example, if I type something in the password2 field and hit enter straight away, the actual submission happens for the expected in Dojo? How come does it happen?</p></li>
  <li><p>Is there a better way to get the form's values, so that 'password[0]' and 'password[1]' become an array automatically etc.?</p></li>
  </ol>