2 * Ext JS Library 2.2.1
\r
3 * Copyright(c) 2006-2009, Ext JS, LLC.
\r
4 * licensing@extjs.com
\r
6 * http://extjs.com/license
\r
9 // Add the additional 'advanced' VTypes
\r
10 Ext.apply(Ext.form.VTypes, {
\r
11 daterange : function(val, field) {
\r
12 var date = field.parseDate(val);
\r
17 if (field.startDateField && (!this.dateRangeMax || (date.getTime() != this.dateRangeMax.getTime()))) {
\r
18 var start = Ext.getCmp(field.startDateField);
\r
19 start.setMaxValue(date);
\r
21 this.dateRangeMax = date;
\r
23 else if (field.endDateField && (!this.dateRangeMin || (date.getTime() != this.dateRangeMin.getTime()))) {
\r
24 var end = Ext.getCmp(field.endDateField);
\r
25 end.setMinValue(date);
\r
27 this.dateRangeMin = date;
\r
30 * Always return true since we're only using this vtype to set the
\r
31 * min/max allowed values (these are tested for after the vtype test)
\r
36 password : function(val, field) {
\r
37 if (field.initialPassField) {
\r
38 var pwd = Ext.getCmp(field.initialPassField);
\r
39 return (val == pwd.getValue());
\r
44 passwordText : 'Passwords do not match'
\r
47 Ext.onReady(function(){
\r
49 Ext.QuickTips.init();
\r
51 // turn on validation errors beside the field globally
\r
52 Ext.form.Field.prototype.msgTarget = 'side';
\r
54 var bd = Ext.getBody();
\r
57 * ================ Date Range =======================
\r
60 var dr = new Ext.FormPanel({
\r
63 title: 'Date Range',
\r
64 bodyStyle:'padding:5px 5px 0',
\r
66 defaults: {width: 175},
\r
67 defaultType: 'datefield',
\r
69 fieldLabel: 'Start Date',
\r
73 endDateField: 'enddt' // id of the end date field
\r
75 fieldLabel: 'End Date',
\r
79 startDateField: 'startdt' // id of the start date field
\r
86 * ================ Password Verification =======================
\r
89 var pwd = new Ext.FormPanel({
\r
92 title: 'Password Verification',
\r
93 bodyStyle:'padding:5px 5px 0',
\r
97 inputType: 'password'
\r
99 defaultType: 'textfield',
\r
101 fieldLabel: 'Password',
\r
105 fieldLabel: 'Confirm Password',
\r
108 initialPassField: 'pass' // id of the initial password field
\r