1. #21
    Ext User bobbicat71's Avatar
    Join Date
    Dec 2007
    Location
    Italy
    Posts
    20
    Vote Rating
    1
    bobbicat71 is on a distinguished road

      0  

    Default


    Quote Originally Posted by DigitalSkyline View Post
    I know this is probably a dumb question, but how do I simply limit the number of characters in a field?
    Thanks for the question that has revealed a bug in the code. Take the latest version in the first post and for a control over the number of characters you can do this:

    Example 1 - 3 numeric values:
    new Ext.form.TextField({plugins: [new Ext.ux.InputTextMask('999', true)]});

    Example 2 - 4 alphanumeric values:
    new Ext.form.TextField({plugins: [new Ext.ux.InputTextMask('AAAA', true)]});

    Example 3 - 2 character (all kinds):
    new Ext.form.TextField({plugins: [new Ext.ux.InputTextMask('X.XX.X', true)]});

  2. #22
    Ext User DigitalSkyline's Avatar
    Join Date
    Apr 2007
    Location
    Rochester, MI
    Posts
    461
    Vote Rating
    1
    DigitalSkyline is on a distinguished road

      0  

    Default


    Ok, but what if I want to limit to say 20/40/100 characters ... maybe there could be a config option for this. It would probably be easy to add so I may be posting again with an update.

    other things -
    In your (new) code, I think this is not used:
    Ext.namespace('Ext.ux.netbox');


    In my code, I'm using Ext's way to prototype (just thought I'd share I know there's no real difference):

    // Add escape prototype feature to RegExp object
    Ext.applyIf(RegExp, {
    /**
    * extend RegExp class with a escape method
    * @return {String} An escaped string.
    */
    escape : function(str) {
    return new String(str).replace(/([.*+?^=!:${}()|[\]\/\\])/g, '\\$1');
    }
    });

  3. #23
    Ext User dandfra's Avatar
    Join Date
    Jun 2007
    Location
    Trento, Italy
    Posts
    122
    Vote Rating
    0
    dandfra is on a distinguished road

      0  

    Question


    Ok, but what if I want to limit to say 20/40/100 characters ... maybe there could be a config option for this. It would probably be easy to add so I may be posting again with an update.
    I'm not sure I'm following you....
    Is this a problem of expressing a mask with less characters?
    For example for a number of exactly 10 digits you now write:
    HTML Code:
    new Ext.form.TextField({plugins: [new Ext.ux.InputTextMask('9999999999', true)]});
    What do you want to write instead? I'm open for suggestions

  4. #24
    Ext User DigitalSkyline's Avatar
    Join Date
    Apr 2007
    Location
    Rochester, MI
    Posts
    461
    Vote Rating
    1
    DigitalSkyline is on a distinguished road

      0  

    Default


    I decided this wasn't the best plug-in for that purpose

    The problem is that maxlength is not being set in the html by Ext, even thought there is a maxLength in Ext. Ext allows any number of characters regardless of this setting, the only thing Ext does is mark the field as invalid if the characters exceed the threshold.

    The preferred behavior would be for no input beyond the maxLength.

    Maybe a separate plug-in would be better, or some Ext override. Haven't had much time to explore this.

    PS ... my preferred syntax would be :
    PHP Code:
    new Ext.ux.InputTextMask({
    mask:'9999999999'
    clearInvalid:true
    }) 

  5. #25
    Ext User DigitalSkyline's Avatar
    Join Date
    Apr 2007
    Location
    Rochester, MI
    Posts
    461
    Vote Rating
    1
    DigitalSkyline is on a distinguished road

      0  

    Lightbulb


    JIC: This config fixes my issue:

    PHP Code:
    autoCreate : {tag"input"type"text"size"20"maxlength:20autocomplete"off"

  6. #26
    Sencha User
    Join Date
    Oct 2007
    Posts
    9
    Vote Rating
    0
    wemakeitwork is on a distinguished road

      0  

    Default bug?

    bug?


    I encountered a bug with this mask : X[0|1]X9:99 X[a|p]Xm

    I fixed this by resetting regexp to '', not null :

    Code:
    for(var i=0; i<mask.length; i++){
            if(regexp){
                if(regexp == 'X'){
                    regexp = '';
                }
                if(mask.charAt(i) == 'X'){
                    this.maskArray[mai] = regexp;
                    mai++;
                    regexp = ''; // <= RIGHT HERE !
                } else {
                    regexp += mask.charAt(i);
                }
            } 
            ...snip...
        }

  7. #27
    Ext User bobbicat71's Avatar
    Join Date
    Dec 2007
    Location
    Italy
    Posts
    20
    Vote Rating
    1
    bobbicat71 is on a distinguished road

      0  

    Default


    Quote Originally Posted by wemakeitwork View Post
    I encountered a bug with this mask : X[0|1]X9:99 X[a|p]Xm

    I fixed this by resetting regexp to '', not null :

    Code:
    for(var i=0; i<mask.length; i++){
            if(regexp){
                if(regexp == 'X'){
                    regexp = '';
                }
                if(mask.charAt(i) == 'X'){
                    this.maskArray[mai] = regexp;
                    mai++;
                    regexp = ''; // <= RIGHT HERE !
                } else {
                    regexp += mask.charAt(i);
                }
            } 
            ...snip...
        }

    Thank you for reporting but the bug that you found is no more present in the code since 7 January 2008. Maybe your code was not updated to the latest version that you can find in the first post.

  8. #28
    Ext User fother's Avatar
    Join Date
    Sep 2007
    Location
    Brazil
    Posts
    744
    Vote Rating
    -1
    fother is an unknown quantity at this point

      0  

    Default


    in opera 9.25 for windows xp if you use the "backspace" or "delete" for clear your input.. the mask fail..

  9. #29
    Ext User fother's Avatar
    Join Date
    Sep 2007
    Location
    Brazil
    Posts
    744
    Vote Rating
    -1
    fother is an unknown quantity at this point

      0  

  10. #30
    Ext User dandfra's Avatar
    Join Date
    Jun 2007
    Location
    Trento, Italy
    Posts
    122
    Vote Rating
    0
    dandfra is on a distinguished road

      0  

    Exclamation Opera is not supported at the moment...

    Opera is not supported at the moment...


    Yes, I know...
    The problem is that we don't support Opera at the moment (we don't need it, we are a bit short with our roadmaps and with Opera some events (such the Backspace and the Delete) are not easyly stoppable...).
    We will support Opera when we will find the time to look at the problem...
    All the patches are welcome...

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi