I have a date field in this form:
{
xtype:'datefield',
name:'order[date]',
id:'dato',
format:'d-m-Y',
allowBlank: false,
cls:'input_single',
emptyText:'dd-mm-yyyy',
minValue:new Date().add('d',-1),
onFocus: function(){
if (this.el.getValue() == 'dd-mm-yyyy') {
Ext.getCmp('dato').setValue('');
}
},
msgTarget:'side',
minText:'Must be future date',
validationEvent:false
}
Now my problem is that I want to force the user to use the dd-mm-yyyy format, but with the code above, the user can enter 01102010 on October 1, 2010.
I thought the format: "dmy" will force this, but it is not.
Validation must be on the client side.
Thus, either the field should reformat the date before 01-10-2010 onblur, or it should simply not allow other formats than dd-mm-yyyy. The latest version is preferable :)
Thanks in advance!
source
share