1. #1
    Ext User
    Join Date
    Apr 2008
    Posts
    9
    Vote Rating
    0
    victorderidder is on a distinguished road

      0  

    Arrow vtypeText for dateField?

    vtypeText for dateField?


    Hi,

    I'm using the dateField component in my form with this code:

    Code:
    new Ext.form.DateField({
                            fieldLabel: 'Geboortedatum',
                            name: 'geboortedatum',
                            width:190,
                                  
                                                    vtypeText: 'Gebruik het formaat dd-mm-jjjj of gebruik de kalender functie.',
                            allowBlank:false,
                                                    blankText: 'Dit is een verplicht veld.',
                                                    format:'d-m-Y'
                        })
    If the user enters nothing, it will display a nice message that the datefield is required, but what vtype should I use to validate if it is a correct date?

    Now I'm getting the default warning: 'xxx is not a vaild date. It should be in the format ...'

  2. #2
    Touch Premium Member jeffcrilly's Avatar
    Join Date
    May 2008
    Posts
    89
    Vote Rating
    0
    jeffcrilly is on a distinguished road

      0  

    Default


    I have the same exact issue.

    Is there a workaround?

  3. #3
    Sencha User
    Join Date
    Oct 2012
    Posts
    2
    Vote Rating
    0
    madhuri123 is on a distinguished road

      0  

    Default vtypeText for dateField

    vtypeText for dateField


    How to change default validation text for datefield ?

  4. #4
    Sencha User
    Join Date
    Apr 2013
    Posts
    9
    Vote Rating
    0
    extjsquicklearner is on a distinguished road

      0  

    Default Create your own VType with a valid regular expression and use it.

    Create your own VType with a valid regular expression and use it.


    Create your own VType with a valid regular expression and use it.
    Ext.apply(Ext.form.VTypes, {
    'TimeVType' : function(time){
    var re = /^([0-1]?[0-9]|2[0-3])[0-5][0-9])$/;
    if(re.test(time)){
    return re;
    }
    else
    {
    return false;
    }
    },
    'TimeVTypeText' : 'Time must have the format HH:MM and within range 00:00 - 23:59'
    });