1. #1
    Sencha User
    Join Date
    Mar 2007
    Posts
    464
    Vote Rating
    1
    JorisA is on a distinguished road

      0  

    Default [2.0rc1][CLOSED] emptyText is submitted

    [2.0rc1][CLOSED] emptyText is submitted


    When I submit a form, the emptyText values of textareas are submitted as well. This seems kinda unlogical to me, and I think it was not meant to be either if I have a look at Field.js

  2. #2
    Sencha User
    Join Date
    Apr 2012
    Location
    Austin, Texas
    Posts
    2
    Vote Rating
    0
    brian.moeskau is an unknown quantity at this point

      0  

    Default


    I think this has been discussed before, with Jack's answer being that it is the developer's responsibility to clear that out prior to submission. Although I could be remembering something else...

  3. #3
    Sencha User
    Join Date
    Mar 2007
    Posts
    464
    Vote Rating
    1
    JorisA is on a distinguished road

      0  

    Default


    Hmm maybe I asked about this before :P
    But if you have a look at Field.js:

    Code:
        /**
         * Returns the raw data value which may or may not be a valid, defined value.  To return a normalized value see {@link #getValue}.
         * @return {Mixed} value The field value
         */
        getRawValue : function(){
            var v = this.rendered ? this.el.getValue() : Ext.value(this.value, '');
            if(v === this.emptyText){
                v = '';
            }
            return v;
        },
    
        /**
         * Returns the normalized data value (undefined or emptyText will be returned as '').  To return the raw value see {@link #getRawValue}.
         * @return {Mixed} value The field value
         */
        getValue : function(){
            if(!this.rendered) {
                return this.value;
            }
            var v = this.el.getValue();
            if(v === this.emptyText || v === undefined){
                v = '';
            }
            return v;
        },
    And I don't really see the point of ever sending it anyway.

  4. #4

  5. #5
    jay@moduscreate.com's Avatar
    Join Date
    Mar 2007
    Location
    Frederick MD, NYC, DC
    Posts
    16,353
    Vote Rating
    77
    jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all

      0  

    Default


    Quote Originally Posted by brian.moeskau View Post
    I think this has been discussed before, with Jack's answer being that it is the developer's responsibility to clear that out prior to submission. Although I could be remembering something else...
    No you're right. I remember this one vividly.

  6. #6
    Ext User
    Join Date
    Jul 2007
    Location
    Florida
    Posts
    9,996
    Vote Rating
    5
    mjlecomte will become famous soon enough mjlecomte will become famous soon enough

      0  

    Default


    Just cross linking this thread to a doc suggestion (to help anyone falling into this thread in future):
    http://extjs.com/forum/showthread.ph...750#post251750