Page 1 of 2 12 LastLast
Results 1 to 10 of 16

Thread: change value of allowBlank parameter

  1. #1
    Sencha User
    Join Date
    Mar 2007
    Location
    Tours, France
    Posts
    97

    Default change value of allowBlank parameter

    Hello,
    I have a form with several elements.
    Initially, all elements are required.
    But if I select a value in a combox, I would like to change the parameter "allowBlank" true to another field.
    How?
    Thank you in advance for your answers
    ps: sorry for my English

  2. #2
    Sencha User
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,245

    Default

    Code:
    otherField.allowBlank = false;
    otherField.validate();

  3. #3
    Sencha User
    Join Date
    Mar 2007
    Location
    Tours, France
    Posts
    97

    Default

    thank works perfect

  4. #4
    Sencha Premium Member
    Join Date
    Apr 2009
    Posts
    110

    Default allowBlank?

    Is allowBlank officially a public property. Its not in the docs.

  5. #5
    Sencha User
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,245

    Default

    Not officially, but it's hasn't changed since its introduction, so it's pretty safe to use.

  6. #6
    Ext JS Premium Member
    Join Date
    Jul 2010
    Location
    UK
    Posts
    534

    Default

    Is this a valid approach?

    Code:
    Ext.getCmp('myid').allowBlank = true;
    Ext.getCmp('myid').validate();
    
    Ext.getCmp('myid').allowBlank = false;
    Ext.getCmp('myid').validate();

  7. #7

    Default

    Yes, this works perfectly.

  8. #8
    Sencha User
    Join Date
    Mar 2012
    Posts
    10

    Default Form field's style changed

    Ext.getCmp('myid').allowBlank = false; Ext.getCmp('myid').validate();

    That is working fine but one thing: the field border is changed to red right after
    running field.validate().
    Is there any way to keep field's border color no change ?
    Thanks



  9. #9
    Sencha User
    Join Date
    May 2012
    Location
    Istanbul
    Posts
    1,335

    Default use clearInvalid

    Hi Larryan;

    you can try to use
    Code:
     field.clearInvalid()
    http://docs.sencha.com/ext-js/3-4/#!/api/Ext.form.Field-method-clearInvalid

    Regards.

  10. #10
    Sencha User
    Join Date
    Mar 2012
    Posts
    10

    Default change value of allowBlank parameter

    Perfect!
    Thank you

Page 1 of 2 12 LastLast

Posting Permissions

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