//define a new custom text field Ext.define('IN.view.item.UpperCaseTextField', { extend: 'Ext.form.field.Text', alias : 'widget.myUpperCaseTextField', fieldStyle: { textTransform: "uppercase" }, initComponent: function() { this.callParent(arguments); }, listeners: { change: function (obj, newValue) { console.log(newValue); obj.setRawValue(newValue.toUpperCase()); } } }); //use the newly created custom text field in your view definition using the alias xtype: 'form', items: [ { xtype: 'myUpperCaseTextField', itemId: 'itemNumber', name : 'item', allowBlank: false, msgTarget: 'side', fieldLabel: 'Item Number', size: 11, maxLength: 10 }, { ..... }, { ..... }, { ..... } ]
Blog Archive
-
▼
2011
(221)
-
▼
December
(18)
- ExtJs PagingMemoryProxy example using JSON data fr...
- ExtJs Grid JSON Java Servlet example with Grid Fil...
- ExtJs Grid JSON Java Servlet example with Grid Fil...
- ExtJs 4 File Upload Java Servlet using Apache comm...
- ExtJs RadioGroup buttons with images for boxLabel
- ExtJs 4 force UpperCase Text input field
- Java connect to MySQL database example using JDBC
- ExtJs 4 MVC Architecture tutorial using Java Servl...
- ExtJs 4 MVC Architecture tutorial using Java Servl...
- ExtJs 4 MVC Architecture tutorial using Java Servl...
- ExtJs 4 MVC Architecture tutorial using Java Servl...
- ExtJs 4 MVC Architecture tutorial using Java Servl...
- ExtJs 4 MVC Architecture tutorial using Java Servl...
- ExtJs 4 set Decimal precision using custom number ...
- Javascript call function in parent frame from chil...
- jQuery autocomplete example using Java Servlet Aja...
- Java Multithreaded Socket server example code
- Java Socket client example - Connect to a Multi Th...
-
▼
December
(18)

ExtJs 4 force UpperCase Text input field
If you want only uppercase input for your text field then extend the base text field to change the field style to uppercase and also attach a listener to update the raw value on any text change to uppercase. Here is an example