1. #1
    Ext User
    Join Date
    Aug 2009
    Posts
    7
    Vote Rating
    0
    consolex is on a distinguished road

      0  

    Default VType for filename

    VType for filename


    Hi,


    i have a problem concerning VTypes:

    Following code doesnt work.
    fileTest = /^([a-zA-Z0-9]+)\.([a-zA-Z]{3})$/i;
    Ext.apply(Ext.form.VTypes, {
    // vtype validation function
    file: function(val, field) {
    return fileTest.test(val);
    },
    // vtype Text property: The error text to display when the validation function returns false
    fileText: 'No valid Filename',
    // vtype Mask property: The keystroke filter mask
    fileMask: /[A-Za-z0-9\.]/i
    });
    Any clue? And what is the "i" for after $ ?

    Thanks for helping

  2. #2
    Sencha User BitPoet's Avatar
    Join Date
    Sep 2008
    Location
    Bavaria
    Posts
    277
    Vote Rating
    1
    BitPoet is on a distinguished road

      0  

    Default


    What does "doesn't work" mean? Please be a bit more verbose in your problem description.

    As for the "/i", that's a so-called regexp modifier, those are
    - "i" to do case insensitive matching
    - "s" for single line matching, i.e. treat the whole string as a single line and have "." (and implicietly also negated character classes like [^a-z] or \D) also match newline characters
    - "m" for multi line matching, i.e. have match "^" after embedded newlines and "$" match before embedded newlines

    Specifying both "a-z" and "A-Z" in your character class together with the "i" modifier is an unnecessary redundancy.

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