1、Html文本框
如:<input type="text" name="test" id="test" >
获取值的方式为:
var tValue = Ext.getDom('test').value;
或者
var tValue = document.getElementById('test').value
2、ExtJs的组件
如:{
id:'test',
xtype:'textfield',
fieldLabel:' 测试',
name:'test',
width:370
}
获取值的方式为:
var tValue = Ext.getCmp('test').getValue()
如:<input type="text" name="test" id="test" >
获取值的方式为:
var tValue = Ext.getDom('test').value;
或者
var tValue = document.getElementById('test').value
2、ExtJs的组件
如:{
id:'test',
xtype:'textfield',
fieldLabel:' 测试',
name:'test',
width:370
}
获取值的方式为:
var tValue = Ext.getCmp('test').getValue()
本文介绍了如何在Html和ExtJs中获取文本框的值。对于Html,可以通过getElementById或Ext.getDom来实现;而在ExtJs中,则使用Ext.getCmp获取组件后调用getValue方法。
4548

被折叠的 条评论
为什么被折叠?



