I am trying to get the error message of a form field, that is displayed by default as a tip on hovering over the field. I am able to get whether the field is valid or not by using either of validate() or isValid() functions.
How do I get the actual error message that has marked the field as invalid? I need to show all error messages for all fields on the form together in one place.
You can do something like this:
var errMsg = "";
xform.getForm().items.each(function(field) {
if (errMsg === "" && field.isValid() == false) {
errMsg = "Error in field " + field.fieldLabel
+ ". " + field.el.dom.qtip;
Well, this is a pretty old thread. Since then, I have moved to Ext 3.x, which provides getAllErrors() and getActiveError() method for a form field out of the box.