在form的文本框中输入数据的时候,显示一些关于这个文本框的文字提示。
或者把这些文字提示放在文本框后面也可以。
应该怎么实现??
类似图片效果。
[b]问题补充:[/b]
如图,这个文字提示是不需要验证的
就是说在填写前就显示的。 :oops:
qtip title under side
这些都是验证以后出现的提示?
在form的文本框中输入数据的时候,显示一些关于这个文本框的文字提示。
或者把这些文字提示放在文本框后面也可以。
应该怎么实现??
类似图片效果。
[b]问题补充:[/b]
如图,这个文字提示是不需要验证的
就是说在填写前就显示的。 :oops:
qtip title under side
这些都是验证以后出现的提示?
详细看看api就明白了.extjs已经帮你实现了这些,而且比你想像的更加完美
[code="js"]
Ext.QuickTips.init();//初始化提示组件
Ext.form.Field.prototype.msgTarget = 'side';//验证信息显示的位置 side表示在右边
/*其他位置的api信息
Value Description
qtip Display a quick tip when the user hovers over the field
title Display a default browser title attribute popup
under Add a block div beneath the field containing the error text
side Add an error icon to the right of the field with a popup on hover
[element id] Add the error text directly to the innerHTML of the specified element
*/
new Ext.form.TextField({
emptyText:'请在这里输入证件号码..',//这个就可以再文本框中显示出来,你文本框获得焦点的时候就会消失.意思就是当文本框没有内容的时候,默认显示这个文本
allowBlank : false,//不允许为空
blankText : '请填写暂住证地址'//当为空的时候就会出现这个提示字符
})[/code]