Results 1 to 3 of 3

Thread: required field marking

  1. #1
    Ext JS Premium Member
    Join Date
    Sep 2009
    Posts
    164
    Vote Rating
    1
      0  

    Default required field marking

    hi guys,

    in ext3 I've used an override of the formlayout to adjust fieldlabels which have the config option allowBlank to be prefixed with an asterisk. This asterisks lets the user now that the field is required on a form. As the formlayout is no longer available in ext 4 I was wondering how I could simply fix this. I still didn't find a config option for this in ext, so I suppose it should be hacked into the code?

    kind regards,

    Michael

  2. #2
    Ext JS Premium Member
    Join Date
    Sep 2009
    Posts
    164
    Vote Rating
    1
      0  

    Default

    anybody?

  3. #3
    Sencha User
    Join Date
    Jul 2008
    Posts
    3
    Vote Rating
    0
      0  

    Default

    Ext.override(Ext.form.Field, {
    initComponent:function () {
    this.callParent(arguments);
    this.on('beforerender', function (target) {
    if (target && !target.rendered && target.isFieldLabelable && target.fieldLabel && target.allowBlank == false) {
    target.fieldLabel += '<span class="req" style="color:red">*</span>';
    }
    })


    }
    })

Similar Threads

  1. Simple override for marking required fields
    By zhegwood in forum Ext 3.x: User Extensions and Plugins
    Replies: 5
    Last Post: 23 Jan 2012, 4:43 AM
  2. Replies: 0
    Last Post: 24 Aug 2010, 12:02 PM
  3. vtype is marking field invalid before ajax returns
    By hallikpapa in forum Ext 3.x: Help & Discussion
    Replies: 11
    Last Post: 25 Mar 2010, 4:12 PM

Posting Permissions

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