Looks like we can't reproduce the issue or there's a problem in the test case provided.
  1. #1
    Sencha User
    Join Date
    Mar 2007
    Posts
    22
    Vote Rating
    0
    Gerard Pastis is on a distinguished road

      0  

    Default Forms are not correctly submitted in Chrome 16

    Forms are not correctly submitted in Chrome 16


    Sencha Touch version tested:
    • 1.1.1

    Platform tested against:
    • Chrome 16.0.912.63 m

    Description:
    • Since the update of Chrome to version 16, forms are not correctly submitted. The method is forced to "GET" and no fields are sended.

    Test Case:

    See this URL : http://dev.sencha.com/deploy/touch/examples/forms/


    Steps to reproduce the problem:
    The result that was expected:
    • Request method: POST
    • Request params:
      Code:
      name:
      password:
      email:
      url:
      cool:
      spinner:0
      rank:master
      secret:false
      bio:
      height:0
      enable:0
      team:
      color:green
      number:
      email2:
      url2:
      options:1
      single_text:
      single_toggle:1
      single_slider:60

    The result that occurs instead:
    • Request method: GET
    • Request params:
      Code:
      _dc:1323942902308

    Screenshot:
    • Chrome 16 developper tools (with bug)
    • Safari developper tools (without bug)

    Debugging already done:
    • none

    Possible fix:
    • not provided
    Attached Images

  2. #2
    Sencha User sfahey's Avatar
    Join Date
    Apr 2010
    Posts
    5
    Vote Rating
    1
    sfahey is on a distinguished road

      0  

    Default


    I am also seeing this issue. Form Data is not being posted in Chrome 16.0.912.63 beta. My app is working in Safari, which is one version off from the latest.

    Request header in Chrome:
    PHP Code:
    Request URL:http://www.example.com/index.php?_dc=1323969677449
    Request Method:GET
    Status Code
    :200 OK

    GET index
    .php?_dc=1323969677449 HTTP/1.1Hostwww.example.com Connectionkeep-aliveX-Requested-WithXMLHttpRequestUser-AgentMozilla/5.0 (MacintoshIntel Mac OS X 10_7_2AppleWebKit/535.7 (KHTMLlike GeckoChrome/16.0.912.63 Safari/535.7Content-Typeapplication/x-www-form-urlencodedcharset=UTF-8Accept: */* Referer: http://www.example.comAccept-Encoding: gzip,deflate,sdchAccept-Language: en-US,en;q=0.8Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3Cookie: __utma=93888793.173034037.1292268459.1323107406.1323282572.32; __utmz=93888793.1308170904.21.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none) 
    Request header in Safari:
    PHP Code:
    Request URL:http://www.example.com/index.php
    Request Method:POST
    Status Code
    :200 OK

    Origin
    http://www.example.com
    X-Requested-WithXMLHttpRequest
    User
    -AgentMozilla/5.0 (MacintoshIntel Mac OS X 10_7_2AppleWebKit/534.51.22 (KHTMLlike GeckoVersion/5.1.1 Safari/534.51.22
    Content
    -Typeapplication/x-www-form-urlencodedcharset=UTF-8
    Referer
    http://www.example.com 
    I know it used to work in Chrome 15, and maybe even earlier versions of Chrome 16. Looks like it still works in iOS's browser, but I'm not sure about the latest Android browser.

  3. #3
    Sencha User
    Join Date
    Jan 2011
    Posts
    6
    Vote Rating
    0
    kiteflo is on a distinguished road

      0  

    Default Heavy heavy issue!!!!!!!!!!

    Heavy heavy issue!!!!!!!!!!


    Hi Sencha guys,

    hopefully you have noticed this post as this is a really heavy issue - not sure whether the Chrome guys are responsible for this dilemma, but currently our customers can not submit any data!!! And they start blaming the Sencha framework we are using for this, so hopefully there is a quick fix or workaround for this issue...

    Please help!

    Florian

  4. #4
    Sencha Premium Member
    Join Date
    Feb 2011
    Posts
    60
    Vote Rating
    0
    venumobile is on a distinguished road

      0  

    Default


    Yes, we are having the same problem here. Our forms suddenly stopped working under Chrome 16. This is a serious problem!

  5. #5
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    36,552
    Vote Rating
    814
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    You can add method : 'POST' to your submit():

    Code:
    form.submit({
        method  : 'POST',
        waitMsg : {message:'Submitting', cls : 'demos-loading'}
    });
    I know it's supposed to default to POST but it's not so we can force it to.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  6. #6
    Sencha Premium Member
    Join Date
    Feb 2011
    Posts
    60
    Vote Rating
    0
    venumobile is on a distinguished road

      0  

    Default


    That works for us, Mitchell! Thanks for the quick response.

  7. #7
    Sencha User
    Join Date
    Jan 2011
    Posts
    6
    Vote Rating
    0
    kiteflo is on a distinguished road

      0  

    Default You saved my weekend!

    You saved my weekend!


    Thank you! Works for us as well...puh!

  8. #8
    Sencha User
    Join Date
    Jul 2011
    Posts
    7
    Vote Rating
    0
    fox1charlie is on a distinguished road

      0  

    Default


    this might be a noob question, but how do i set the method to POST if i use the submitOnAcion: true on a fromPanel, to submit the login-data?

    Edit:
    Fixed it by altering the HTML of the form itself (by doing some bad stuff to the "id" property of the form), works for now, isn't a good solution though.

    "Please God forgive me."

    -cheers

  9. #9
    Sencha User
    Join Date
    Dec 2011
    Posts
    2
    Vote Rating
    0
    damrbaby is on a distinguished road

      0  

    Default


    You can also use the beforesubmit event:

    Code:
    var form = Ext.extend(Ext.form.FormPanel, {
      listeners: {
        beforesubmit: function(form, values, options) {
          options.method = "post";
        }
      }
    });

  10. #10
    Sencha User
    Join Date
    Jan 2012
    Posts
    1
    Vote Rating
    0
    bitlyfied is on a distinguished road

      0  

    Default A better patch

    A better patch


    The latest version of Webkit has a default value "get" for the form DOM element.
    Sencha is detecting the method by using this expression:

    Code:
    method : form.method || 'post'
    In Chrome 15 form.method value is undefined, in Chrome 16 it's "get".
    I created a patch that still respects this behaviour, but uses getAttribute instead.

    Just include this patch after you loaded Sencha.


    Code:
    /**
     * Chrome 16 form submit method patch
     * @see http://www.sencha.com/forum/showthread.php?161923-Forms-are-not-correctly-submitted-in-Chrome-16&p=703923#post703923
     */
    
    
    // store the original submit function
    Ext.form.FormPanel.prototype._originalSubmit = Ext.form.FormPanel.prototype.submit;
    
    
    // patch it
    Ext.override(Ext.form.FormPanel, {
        submit: function(options) {
            options = options || {};
    
    
            if(typeof options['method'] === 'undefined' && this.el){
                // if method is not specified, query the form HTML attribute
                // by using this.el.dom.getAttribute instead of this.el.dom.method
                options.method = this.el.dom.getAttribute('method') || 'post';
            }
    
    
            // invoke the original function, but with the method patched
            Ext.form.FormPanel.prototype._originalSubmit.call(this, options);
        }
    });