3 * Copyright(c) 2006-2009 Ext JS, LLC
5 * http://www.extjs.com/license
9 Ext.app.ContactForm = Ext.extend(Ext.FormPanel, {
\r
10 formTitle: 'Contact Information (English)',
\r
11 firstName: 'First Name',
\r
12 lastName: 'Surname',
\r
13 surnamePrefix: 'Surname Prefix',
\r
16 stateEmptyText: 'Choose a state...',
\r
18 birth: 'Date of Birth',
\r
22 initComponent : function(config) {
\r
24 labelWidth: 100, // label settings here cascade unless overridden
\r
25 url:'save-form.php',
\r
27 title: this.formTitle,
\r
28 bodyStyle:'padding:5px 5px 0',
\r
30 defaults: {width: 220},
\r
31 defaultType: 'textfield',
\r
34 fieldLabel: this.firstName,
\r
38 fieldLabel: this.lastName,
\r
41 fieldLabel: this.surnamePrefix,
\r
43 name: 'surnamePrefix'
\r
45 fieldLabel: this.company,
\r
47 }, new Ext.form.ComboBox({
\r
48 fieldLabel: this.province,
\r
49 hiddenName: 'state',
\r
50 store: new Ext.data.ArrayStore({
\r
51 fields: ['provincie'],
\r
52 data : Ext.exampledata.dutch_provinces // from dutch-provinces.js
\r
54 displayField: 'provincie',
\r
57 triggerAction: 'all',
\r
58 emptyText: this.stateEmtyText,
\r
62 fieldLabel: this.email,
\r
65 }, new Ext.form.DateField({
\r
66 fieldLabel: this.birth,
\r
78 Ext.app.ContactForm.superclass.initComponent.apply(this, arguments);
\r
82 Ext.onReady(function(){
\r
83 Ext.QuickTips.init();
\r
85 // turn on validation errors beside the field globally
\r
86 Ext.form.Field.prototype.msgTarget = 'side';
\r
88 var bd = Ext.getBody();
\r
90 bd.createChild({tag: 'h2', html: 'Localized Contact Form'});
\r
93 var simple = new Ext.app.ContactForm();
\r
94 simple.render(document.body);
\r