title: ExtJS - Form submit
body: <p>I've got code:</p>
  
  <pre><code>win = desktop.createWindow({
      id: 'admin-win',
      title: 'Add administration users',
      width: 740,
      height: 480,
      iconCls: 'icon-grid',
      animCollapse: false,
      constrainHeader: true,
      xtype: 'form',
      bodyPadding: 15,
      url: 'save-form.php',
      items: [{
          xtype: 'textfield',
          fieldLabel: 'Field',
          name: 'theField'
      }],
  
      buttons: [{
          text: 'Submit',
          handler: function () {
              var form = this.up('form').getForm();
              if (form.isValid()) {
                  form.submit({
                      success: function (form, action) {
                          Ext.Msg.alert('Success', action.result.message);
                      },
                      failure: function (form, action) {
                          Ext.Msg.alert('Failed', action.result ? action.result.message : 'No response');
                      }
                  });
              }
          }
      }]
  });
  </code></pre>
  
  <p>And buttons doesn't work. It creates error - this.up('form') is undefined. How can I call getForm() in such code like that?</p>
  
  <p>UPDATE:
  Thanks for really quick reply!
  I modified your code for my needs, this is it, and it works with Desktop Example:</p>
  
  <pre><code>win = desktop.createWindow({
      id: 'admin-win',
      title: 'Add administration users',
      width: 740,
      iconCls: 'icon-grid',
      animCollapse: false,
      constrainHeader: true,
      items: [{
          xtype: 'form',
          bodyPadding: 15,
          url: 'save-form.php',
          items: [{
              xtype: 'textfield',
              fieldLabel: 'Field',
              name: 'theField'
          }],
  
          buttons: [{
              text: 'Submit',
              handler: function () {
                  var form = this.up('form').getForm();
                  if (form.isValid()) {
                      this.up().up().submit({
                          success: function (form, action) {
                              Ext.Msg.alert('Success', action.result.message);
                          },
                          failure: function (form, action) {
                              Ext.Msg.alert('Failed', action.result ? action.result.message : 'No response');
                          }
                      });
                  }
              }
          }]
      }]
  });
  </code></pre>