87,910
社区成员
发帖
与我相关
我的任务
分享
<table>
<tr>
<td>
<div id="combo_zone2" style="width:250px; height:30px;"></div>
</td>
</tr>
<tr>
<td>
<div id="logarea" style="background-color:lightgrey;height:218px;width:250px; overflow:auto"></div>
</td>
</tr>
</table>
<script>
var combo = new dhtmlXCombo("combo_zone2", "alfa2", 250);
combo.loadXML("../common/data.xml");
function doLog(str) {
var log = document.getElementById("logarea");
log.innerHTML = log.innerHTML + str + "<br/>";
log.scrollTop = log.scrollHeight;
}
combo.attachEvent("onChange", onChangeFunc); //注册事件
combo.attachEvent("onKeyPressed", onKeyPressedFunc);
combo.attachEvent("onSelectionChange", onSelectionChangeFunc);
combo.attachEvent("onBlur", onBlurFunc);
function onChangeFunc() {
doLog("" + 'onChange' + " event has occured");
return true;
}
function onKeyPressedFunc(key) {
doLog("Key " + key + " was pressed");
return true;
}
function onSelectionChangeFunc() {
doLog("Selection was changed");
return true;
}
function onBlurFunc() {
doLog("" + 'onBlur' + " event has occured");
return true;
}
</script>
<table>
<tr>
<td>
<div id="combo_zone2" style="width:250px; height:30px;"></div>
</td>
</tr>
<tr>
<td>
<div id="logarea" style="background-color:lightgrey;height:218px;width:250px; overflow:auto"></div>
</td>
</tr>
</table>
<script>
var combo = new dhtmlXCombo("combo_zone2", "alfa2", 250);
combo.loadXML("../common/data.xml");
function doLog(str) {
var log = document.getElementById("logarea");
log.innerHTML = log.innerHTML + str + "<br/>";
log.scrollTop = log.scrollHeight;
}
combo.attachEvent("onChange", onChangeFunc); //注册事件
combo.attachEvent("onKeyPressed", onKeyPressedFunc);
combo.attachEvent("onSelectionChange", onSelectionChangeFunc);
combo.attachEvent("onBlur", onBlurFunc);
function onChangeFunc() {
doLog("" + 'onChange' + " event has occured");
return true;
}
function onKeyPressedFunc(key) {
doLog("Key " + key + " was pressed");
return true;
}
function onSelectionChangeFunc() {
doLog("Selection was changed");
return true;
}
function onBlurFunc() {
doLog("" + 'onBlur' + " event has occured");
return true;
}
</script>
<table>
<tr>
<td>
<div id="combo_zone2" style="width:250px; height:30px;"></div>
</td>
</tr>
<tr>
<td>
<div id="logarea" style="background-color:lightgrey;height:218px;width:250px; overflow:auto"></div>
</td>
</tr>
</table>
<script>
var combo = new dhtmlXCombo("combo_zone2", "alfa2", 250);
combo.loadXML("../common/data.xml");
function doLog(str) {
var log = document.getElementById("logarea");
log.innerHTML = log.innerHTML + str + "<br/>";
log.scrollTop = log.scrollHeight;
}
combo.attachEvent("onChange", onChangeFunc); //注册事件
combo.attachEvent("onKeyPressed", onKeyPressedFunc);
combo.attachEvent("onSelectionChange", onSelectionChangeFunc);
combo.attachEvent("onBlur", onBlurFunc);
function onChangeFunc() {
doLog("" + 'onChange' + " event has occured");
return true;
}
function onKeyPressedFunc(key) {
doLog("Key " + key + " was pressed");
return true;
}
function onSelectionChangeFunc() {
doLog("Selection was changed");
return true;
}
function onBlurFunc() {
doLog("" + 'onBlur' + " event has occured");
return true;
}
</script>