ExtJS4: How to show validation error message next to textbox, combobox etc

berliner picture berliner · Jun 3, 2012 · Viewed 52k times · Source

I need to implement validation messages that appear right next to invalid field. Any help would be appreciated.

Answer

Jom picture Jom · Jun 5, 2012

msgTarget: 'side' will Add an error icon to the right of the field, displaying the message in a popup on hover only.

if you read the documentation carefully, one more option is there for msgTarget http://docs.sencha.com/ext-js/4-1/#!/api/Ext.form.field.Text-cfg-msgTarget

[element id] Add the error message directly to the innerHTML of the specified element. you have to add a "td" to the right side of the control dynamically with the id. then if you specify msgTarget: 'element id' it will work.