PDA

View Full Version : [CLOSED] Examples: Registration Form



cwolcott
Sep 10, 2012, 6:03 PM
After launching Form -> Miscellaneous -> Registration Form (http://examples2.ext.net/#/Form/Miscellaneous/Registration_Form/)example place the mouse to the left of the "Submit Registration" button. The Error Details window is displayed even though there are no issues yet. Any way to fix this?

I like the look of this error handling for a simple form and want to resuse it.

Vladimir
Sep 10, 2012, 7:27 PM
Hi,

1. Set Disabled="true" for the tooltip
2. Update setErrors method


function setErrors (cmp, errors) {
var me = cmp,
baseCls = me.baseCls,
tip = me.tooltips[0];


errors = Ext.Array.from(errors);


// Update CSS class and tooltip content
if (errors.length) {
me.addCls(baseCls + '-invalid');
me.removeCls(baseCls + '-valid');
me.update("Form has errors");
tip.setDisabled(false);
if (!tip.rendered) {
tip.show();
}
tip.update(me.bin[0].apply(errors));
} else {
me.addCls(baseCls + '-valid');
me.removeCls(baseCls + '-invalid');
me.update("Form is valid");
tip.setDisabled(true);
tip.hide();
}
}

cwolcott
Sep 11, 2012, 1:45 AM
Perfect. Please close. Thanks.

Daniil
Sep 14, 2012, 3:02 PM
Hi Chris,

The respective changes have been committed to the 2.1 branch.

Thank you for pointing the problem out.