1. #1
    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 Mask Input Plugin for TextField - Cross Browser

    Mask Input Plugin for TextField - Cross Browser


    Credits for:
    Softfocus Sistemas: www.softfocus.com.br
    Demo: http://www.ricardosantos.com.br/extjs/example-form.php - Ext 1.0

    I caught him the script and modified for use with 2.0 ext

    work fine in ie, firefox, opera..
    Someone can test with the safari?

    ext-extend.js
    [CODE]
    Ext.namespace("Ext.ux","Ext.ux.form");

    Ext.QuickTips.init();

    // Extends Javascript Functions

    String.prototype.trim = function() { return this.replace(/^\s+|\s+$/g, ''); };

    //
    // form extends
    //
    Ext.ux.colfield = function(form, type, label, name, width, objconffield, objconf )

    {
    var config = {
    width: width
    };

    Ext.apply( config, objconf );

    var newField = Ext.ux.retfield( type, label, name, objconffield )
    return newField;
    }

    Ext.ux.retfield = function( type, label, name, width, objconf )
    {
    var newField = {}, config = {
    fieldLabel: label,
    name: name,
    width: width,
    preventScrollbars: true,
    cls: '',
    allowBlank: true
    };

    Ext.apply( config, objconf );

    if( config.width == undefined || config.width == 0 ) delete config.width;

    switch( type )
    {
    case 'e':
    config.vtype = 'email';
    case 't':
    case 'text':
    var newField = new Ext.form.TextField( config );
    break;
    case 'tn':
    case 'textnome':
    var newField = new Ext.form.TextField( config );
    newField.on('change', function( field, str ) { field.setValue(Ext.ux.form.masknome(str)); });
    break;
    case 'tel':
    config.maskRe = /[0-9]/;
    config.mask = '(##) ####-####';
    config.minLength = 9;
    config.valueDefault = '(13';
    var newField = new Ext.form.TextField( config );

    Ext.ux.form.Masking( newField );
    break;

    case 'cpfcnpj':
    config.maskRe = /[0-9]/;
    config.mask = config.mask1 = '###.###.###-##';
    config.mask2 = '##.###.###/####-##';
    config.minLength = 14;
    var newField = new Ext.form.TextField( config );

    Ext.ux.form.Masking( newField );
    newField.on('valid', function( field ) {
    var v = field.getValue(), n = v.replace( /[^0-9]/g, '' );
    if( n.length == 11 && !Ext.ux.form.chkcpf(n)) field.markInvalid('O CPF est

  2. #2
    Ext User
    Join Date
    Dec 2007
    Location
    Maida Vale
    Posts
    96
    Vote Rating
    0
    dearsina is on a distinguished road

      0  

    Default


    Do you have an example running?

  3. #3
    Ext JS Premium Member
    Join Date
    Mar 2007
    Location
    France
    Posts
    223
    Vote Rating
    0
    tof is on a distinguished road

      0  

    Default


    Quote Originally Posted by dearsina View Post
    Do you have an example running?
    Yes, on the given link (with ext 1.0).

    Good work !

  4. #4
    Sencha User galdaka's Avatar
    Join Date
    Mar 2007
    Location
    Spain
    Posts
    1,166
    Vote Rating
    -1
    galdaka is an unknown quantity at this point

      0  

    Default


    This forum in for Ext 2.0 extensions and plugins.

  5. #5
    Ext User
    Join Date
    Aug 2007
    Posts
    204
    Vote Rating
    0
    DragonFist is on a distinguished road

      0  

    Default


    Quote Originally Posted by galdaka View Post
    This forum in for Ext 2.0 extensions and plugins.
    --------------------------------------------------------------------------------

    Credits for:
    Softfocus Sistemas: www.softfocus.com.br
    Demo: http://www.ricardosantos.com.br/extjs/example-form.php - Ext 1.0

    I caught him the script and modified for use with 2.0 ext
    Really need to read everything before reprimanding someone.

  6. #6
    Sencha User galdaka's Avatar
    Join Date
    Mar 2007
    Location
    Spain
    Posts
    1,166
    Vote Rating
    -1
    galdaka is an unknown quantity at this point

      0  

    Default


    Quote Originally Posted by DragonFist View Post
    Really need to read everything before repremanding someone.
    Sorry. My English is bad and I don

  7. #7
    Ext User
    Join Date
    Oct 2007
    Posts
    1
    Vote Rating
    0
    e_gama is on a distinguished road

      0  

    Default


    I need to modify the source to work correcty...

    original line 21:
    Code:
    var newField = Ext.ux.retfield( type, label, name, objconffield )
    Modified line 21:
    Code:
    var newField = Ext.ux.retfield( type, label, name, width, objconffield )
    Thanks for this perfect plugin.

  8. #8
    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 the next time will be possible use
    xtype: 'inputMask',
    mask: '###-##-##'

    thanks for your suggestion
    are be appreciate

  9. #9
    Ext JS Premium Member
    Join Date
    Jan 2008
    Posts
    50
    Vote Rating
    0
    dewie is on a distinguished road

      0  

    Default Safari not good :(

    Safari not good :(


    There are some problems in safari :


  10. #10
    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


    you can test with ext 2.x?

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