1. #1
    Sencha User
    Join Date
    Nov 2011
    Posts
    20
    Vote Rating
    0
    simonr26 is on a distinguished road

      0  

    Question Unanswered: How carry out form submission using JSON, Ajax?

    Unanswered: How carry out form submission using JSON, Ajax?


    Hello,
    Please can you specify how to carry out form submission using Ajax, JSON


    I have a form with a submit handler as shown below. Ths sends data to
    server using Ajax but not JSON.
    Please can you inform me how this can be done - preferably using a not
    too complicated mechanism.


    Code:
    handler: function() {
        var form = this.up('form').getForm(); // get the basic form
        if (form.isValid()) { // make sure the form contains valid data before submitting
            form.submit({
    		url:'/dest/frm',
                   success: function(form, action) {
                    Ext.Msg.alert('Success', action.result.msg);
                },
                failure: function(form, action) {
                    Ext.Msg.alert('Failed', action.result.msg);
                }
            });
        } else { // display error alert if the data is invalid
            Ext.Msg.alert('Invalid Data', 'Please correct form errors.')
        }
    }



    kind regards,
    Simon

  2. #2
    Sencha User tobiu's Avatar
    Join Date
    May 2007
    Location
    Munich (Germany)
    Posts
    2,669
    Answers
    130
    Vote Rating
    110
    tobiu is a name known to all tobiu is a name known to all tobiu is a name known to all tobiu is a name known to all tobiu is a name known to all tobiu is a name known to all

      0  

    Default


    the default implementation of forms is not meant to wrap the params into a JSON string.

    You can call form.getValues() instead submitting it and use a normal ext.ajax call and format the values to your needs using ext.encode or whatever.
    Best regards
    Tobias Uhlig
    __________

    S-CIRCLES Social Network Engine

Thread Participants: 1

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