function DLMISForm_GetControl(tableName, fieldName, position) {
if (0 == document.forms.length) return null;
var controls = document.forms[0];//表示获取当前页面的第一个表单
var len = controls.length;//计算文档中表单的数目。
var partId = "_d:" + tableName + "@" + fieldName;
if ('undefined' != typeof (position) && null != position && 0 < position) {
//position--;
partId = "_" + position + partId;
}
//回参数i,不区分大小写
var reg = new RegExp(partId + "$", "i");
//alert();
var findObj = null;
for (var i = 0; i < len - 1; i++) {
if (reg.test(controls[i].id)) {
findObj = controls[i];
break;
}
}
return findObj;
}
地址:https://developer.mozilla.org/zh-CN/docs/Web/API/Document/forms