Results 1 to 6 of 6

Thread: submitValue of disabled textfield

  1. #1

    Join Date
    Jan 2008
    Location
    Levittown, PA
    Posts
    364
    Answers
    2

    Default Answered: submitValue of disabled textfield

    Anyone having trouble with this on 4.1.1? The value is NOT submit with the form. I have this and the state field disabled. A call to the USPS populates these fields after the zipcode is entered. I can see that the field are populated, but upon submission of the form those fields are not in the POST.


    Code:
    			xtype : 'textfield',
    			fieldLabel : 'City/Town',
    			submitValue : true,
    			name : 'mailingCity',
    			id : 'mailingCity',
    			flex : 1,
    			allowBlank : true,
    			disabled : true

  2. If you just want the field to look disabled (and not the label), then you may use the following configs:

    Code:
    fieldStyle: 'background:#DDDDDD;', // makes the background gray giving a disabled effect to the user
    readOnly: true
    OR use the Scott's recommendation of cls: 'x-item-disabled'

  3. #2
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    9,410
    Answers
    716

    Default

    Disabled fields are not submitted ... have a look at the following:
    http://jsfiddle.net/gk6nF/

    Scott.

  4. #3

    Join Date
    Jan 2008
    Location
    Levittown, PA
    Posts
    364
    Answers
    2

    Default

    Okay, I guess I read the docs wrong. I thought submitValue would override the disabled.

    I will check out readOnly again. I just think that confuses the users into thinking they are doing something wrong by not being able to type in the field, even though they tab into it. Disabled shows them pretty clearly they can't.

    Thanks for the info.

  5. #4
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    9,410
    Answers
    716

    Default

    Setting this to false will prevent the field from being submitted even when it is not disabled.
    Disables the submit when not disabled.

  6. #5
    Touch Premium Member
    Join Date
    Jun 2011
    Posts
    1,102
    Answers
    113

    Default

    If you just want the field to look disabled (and not the label), then you may use the following configs:

    Code:
    fieldStyle: 'background:#DDDDDD;', // makes the background gray giving a disabled effect to the user
    readOnly: true
    OR use the Scott's recommendation of cls: 'x-item-disabled'

  7. #6

    Join Date
    Jan 2008
    Location
    Levittown, PA
    Posts
    364
    Answers
    2

    Default

    I didn't see Scott's suggestion of using "cls" so I ran with yours and this was as close as I could get ...

    Code:
    	style : 'color:#B8B8B8;',
    	fieldStyle : 'background:#F0F0F0;border-color:#C8C8C8;color:#C8C8C8;',
    	readOnly : true

    Then I saw Scott's suggestion and used his to keep it exact!

    Thank you both.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •