ksachdeva
6 Jul 2007, 10:01 AM
Here are some of the issues I have been facing:
a) I would like to use a TextField which is not inside a Form but require client side validation. I am able to create an instance of Ext.form.TextField and use it but the validation messages are displayed as tool tip (i.e. you have to hover the Textfield to see the error). I tried to set Ext.form.Field.prototype.msgTarget = 'under'; but this makes ExtJS throw an error in markInvalid function at
case 'under':
if(!this.errorEl){
var elp = this.el.findParent('.x-form-element', 5, true);
this.errorEl = elp.createChild({cls:'x-form-invalid-msg'});
this.errorEl.setWidth(elp.getWidth(true)-20);
}
this.errorEl.update(msg);
Ext.form.Field.msgFx[this.msgFx].show(this.errorEl, this);
break;
Since I have not put TextField in any form it is obvious that elp will be null and that's why it throws an error at elp.createChild....
b) Putting TextField inside a form so that I can get the error message under the text field but some more issues for me here:
- I do not want to display the ":" between the label and inputbox as I do not want to put the label. Is there a work around ?
- I would like this form to anchor in a content panel with "c-c". But I could not invoke anchor method on form. I could not find how to get the dom element of form so I could anchor that in my panel.
In brief, I would like to have an input box with client side validation where messages are displayed under the input box. This input box should be anchored in a content panel with "c-c".
Would appreciate your help.
Regards & thanks
Kapil
a) I would like to use a TextField which is not inside a Form but require client side validation. I am able to create an instance of Ext.form.TextField and use it but the validation messages are displayed as tool tip (i.e. you have to hover the Textfield to see the error). I tried to set Ext.form.Field.prototype.msgTarget = 'under'; but this makes ExtJS throw an error in markInvalid function at
case 'under':
if(!this.errorEl){
var elp = this.el.findParent('.x-form-element', 5, true);
this.errorEl = elp.createChild({cls:'x-form-invalid-msg'});
this.errorEl.setWidth(elp.getWidth(true)-20);
}
this.errorEl.update(msg);
Ext.form.Field.msgFx[this.msgFx].show(this.errorEl, this);
break;
Since I have not put TextField in any form it is obvious that elp will be null and that's why it throws an error at elp.createChild....
b) Putting TextField inside a form so that I can get the error message under the text field but some more issues for me here:
- I do not want to display the ":" between the label and inputbox as I do not want to put the label. Is there a work around ?
- I would like this form to anchor in a content panel with "c-c". But I could not invoke anchor method on form. I could not find how to get the dom element of form so I could anchor that in my panel.
In brief, I would like to have an input box with client side validation where messages are displayed under the input box. This input box should be anchored in a content panel with "c-c".
Would appreciate your help.
Regards & thanks
Kapil