-
31 Oct 2007 4:59 AM #1
formField, existing input, and validation
formField, existing input, and validation
Hi,
I am trying to use TextField to format and validate an existing input. This is my code:
It works fine, but when validation files, there is a javascript error in the ext in the line with this codeCode:var formField = new Ext.form.TextField({el:"name", maxLength:5, msgTarget: 'side', autoCreate: false}); formField.render();
Error is not in this line, but is caused because B is null. Is it mandatory that my form has the class "x-form-element" ?Code:var B=this.el.findParent(".x-form-element",5,true)
What am i doing wrong? Thank you!!!
-
31 Oct 2007 8:29 AM #2
Assuming that that error is coming from Field.markInvalid, then yes 'x-form-element' is required. It's trying to find the parent container so that it can display the validation error message/icon.
Some of the other field classes can be customized, not sure why that one is hard-coded. Maybe this should be an enhancement.Tim Ryan
Read BEFORE posting a question / BEFORE posting a Bug
Use Google to Search - API / Forum
API Doc (4.x | 3.x | 2.x | 1.x) / FAQ / 1.x->2.x Migration Guide / 2.x->3.x Migration Guide


Reply With Quote