2
votes

Heya, i'm creating a Formpanel:

inputForm = new Ext.FormPanel({
    id:'inputForm',
    frame: true,
    closable:true,
    collapsible:true,
    renderTo:'somewhere',
    layout:'anchor',
    standardSubmit:true,
    method: 'post',
    items:[{ ... }]
)};

and use this submit button:

  text:'run',
  id: 'runButton',
  handler:function(){
         Ext.getCmp('inputForm').getForm().submit();
  }

how can i open the submit page in a new window/tab ????

2
What do you mean by "submit" page? Is it just a page that says it was successful, or will it show some search results/information based on the user's form submission?JamesHalsall
@jaitsu : maybe he want to submit the form to new window/tab like this <form action='blablabla' method='post' target='_blank'>Egy Mohammad Erdin
You'd be far better using the Ajax submit, and then on success opening a pageJamesHalsall

2 Answers

3
votes

Check this sencha forum link

The relevant code snippet:

    form.submit({
        target : '_blank',
        url  : 'refdata/exportToXLS.do'
    });
1
votes

have you fix your problem,.. because I see your question was 2 days ago..

this is how i define the form :

var inputForm = new Ext.FormPanel({
   id:'inputForm',
    method : "POST",
    url : "blablabla.php",
    items : [{...}]
    //standardSubmit : true // i do not need standardSubmit
});

and my button,

  text:'run',
  id: 'runButton',
  handler:function(){
     //Ext.getCmp('inputForm').getForm().submit();
     var form = Ext.getCmp('inputForm').getForm(); // or inputForm.getForm();
     var el = form.getEl().dom;
     var target = document.createAttribute("target");
     target.nodeValue = "_blank";
     el.setAttributeNode(target);
     el.action = form.url;
     el.submit(); 
  }