Hybrid View

  1. #1
    Ext User
    Join Date
    Feb 2008
    Posts
    146
    Vote Rating
    0
    italoc is on a distinguished road

      0  

    Default submit external form and fort GET or POST metod

    submit external form and fort GET or POST metod


    i would like a login module in EXTJS but when i press login button i would like to pass the variable to external php pages.. i can force to redirect the pages when i press the login button but the variable don't are passed to destination page.

    this is my code

    Code:
    new Ext.FormPanel({
                        labelWidth: 50, 
                        url:'save-form.php',
                        frame:true,
                        collapsible: true,
                        title: 'Login',
                        bodyStyle:'padding:5px 5px 0',
                        width: 225,
                        defaults: {width: 140},
                        defaultType: 'textfield',
                
                        items: [{
                                fieldLabel: 'Username',
                                name: 'username',
                                allowBlank:false
                            },{
                                fieldLabel: 'Password',
                                name: 'password',
                                inputType:'password',
                                allowBlank:false
                            }
                        ],
                
                        buttons: [{
                            text:'Login',
                            type: 'submit',
                    handler: function() {
                            			window.location.href = 'http://host/index.php';
    	},				
                                 }]
                      })
    if i write method: 'POST', or GET nothing change...

    please help me...

  2. #2
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246
    Vote Rating
    89
    Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of

      0  

    Default


    Try:

    Code:
    buttons: [{
      text:'Login',
      handler: function() {
        formPanel.getForm().submit({
          success: function() {
            window.location.href = 'http://host/index.php';
          }
        });
      }
    }]
    (this assumes that save-form.php produces the correct response, see docs)

    Another option would be to do a classic submit (see docs).

  3. #3
    Ext User
    Join Date
    Feb 2008
    Posts
    146
    Vote Rating
    0
    italoc is on a distinguished road

      0  

    Default


    i try this:

    buttons: [{
    text:'Login',
    handler: function() {
    formPanel.getForm().submit({
    success: function() {
    window.location.href = 'http://host/index.php';
    }
    });
    }
    }]

    but i receive always an error:

    formPanel is not defined
    [Break on this error] });

    can you post an example of save-form.php configuration? i try to read a docs, but i don't find a solution...

    thanks..

  4. #4
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246
    Vote Rating
    89
    Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of

      0  

    Default


    formPanel should be your FormPanel. If you don't want to store it in a variable you could give it and id and use Ext.getCmp(id).

  5. #5
    Ext User
    Join Date
    Feb 2008
    Posts
    146
    Vote Rating
    0
    italoc is on a distinguished road

      0  

    Default


    very strange... i have modified the code in this way

    Code:
    new Ext.FormPanel({
                        labelWidth: 50, 
                        url:'save-form.php',
                        frame:true,
                        collapsible: true,
                        title: 'Login',
                        bodyStyle:'padding:5px 5px 0',
                        width: 225,
                        defaults: {width: 140},
                        defaultType: 'textfield',
                        method: 'GET',
                        id: 'my-form',
                        items: [{
                                fieldLabel: 'Username',
                                name: 'username',
                                allowBlank:false
                            },{
                                fieldLabel: 'Password',
                                name: 'password',
                                inputType:'password',
                                allowBlank:false
                            }
                        ],
                
                                buttons: [{
                                text:'Login',
                                handler: function() {
                                formPanel = Ext.getCmp('my-form');
                                  formPanel.getForm().submit({
                                    success: function() {
                                      window.location.href = 'http://host/index.php';
                                    }
                                  });
                                }
                              }]
    now the Login form pannel doesn't appear.. if i delete id: 'my-form', the form apper but don't work

    any other solution??

  6. #6
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246
    Vote Rating
    89
    Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of

      0  

    Default


    1. The form should appear, even with the id (unless you already used this id elsewhere).
    2. Your server probably doesn't handle the submit correctly, try:

    Code:
    buttons: [{
    	text:'Login',
    	handler: function() {
    		Ext.getCmp('my-form').getForm().submit({
    			success: function() {
    				window.location.href = 'http://host/index.php';
    			},
    			failure: function(form, action) {
    				alert(action.failureType);
    			}
    		});
    	}
    }],

Thread Participants: 2

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi