1. #1
    Sencha User emredagli's Avatar
    Join Date
    Jun 2008
    Posts
    296
    Vote Rating
    0
    emredagli is on a distinguished road

      0  

    Default Show valid icon if field is valid.

    Show valid icon if field is valid.


    Hii,
    I try to show user name exist or not on create an account.
    So I want to show validity icon on the right side of the textfield on both cases.

    Can I do this with ExtJS validation tools or do I need to custom operation?

    Thanks in advance.

  2. #2
    Sencha User
    Join Date
    Mar 2011
    Posts
    1
    Vote Rating
    0
    Larry0ua is on a distinguished road

      0  

    Default


    Hi,

    I know it's too late to response but hope that my information may help anyone after me.
    Code:
    Ext.reg('textfieldValidator', Ext.extend(Ext.form.TextField, {
            listeners: {valid: function(el) {
                if(el.getValue().length>0) {
                imgid = Ext.get(el.id).next();
                if (imgid) {
                imgid.addClass('x-form-valid-icon');
                imgid.show();
                }}},invalid:function(el){
                    imgid=Ext.get(el.id).next();
                    imgid.removeClass('x-form-valid-icon');
                },render:function(el){el.markInvalid("Fake message");el.clearInvalid();}},
            validator: function(e) {return true;}
        }));
    - registers new xtype 'textfieldValidator' that will use x-form-valid-icon class for valid fields.
    Of course you need to create this class in your css - get example from x-form-invalid-icon records in css and create the same for x-form-valid-icon with changing picture location.

    Not sure if there is more easy way to implement this behavior, but it worked for me.

  3. #3
    Sencha User emredagli's Avatar
    Join Date
    Jun 2008
    Posts
    296
    Vote Rating
    0
    emredagli is on a distinguished road

      0  

    Default


    Thanks for your reply.
    I had resolved it in different way.
    But your solution is better.
    Thanks.

Similar Threads

  1. Composite field do not fire 'valid' event correctly
    By Traktopel in forum Ext 3.x: Help & Discussion
    Replies: 1
    Last Post: 26 Aug 2013, 4:09 AM
  2. Composite field do not fire 'valid' event correctly
    By Traktopel in forum Ext 3.x: Help & Discussion
    Replies: 3
    Last Post: 21 Jun 2010, 6:13 AM
  3. Empty text for Field objects isn't valid?
    By bburton in forum Ext GWT: Discussion
    Replies: 4
    Last Post: 24 Nov 2009, 2:06 PM
  4. [CLOSED] Tooltip on RowEditor does not hide when field is not valid
    By markmacumber in forum Ext GWT: Bugs (2.x)
    Replies: 1
    Last Post: 31 Aug 2009, 4:49 PM
  5. [Solved] Marking Valid Form Fields with Check Icon
    By bzarzuela in forum Ext 2.x: Help & Discussion
    Replies: 2
    Last Post: 22 Jul 2009, 5:16 PM

Thread Participants: 1

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar