function clearFocus(id){
//eval("document.registerForm."+id+".value")="";
//eval("document.registerForm."+id+".focus()");
document.registerForm.id.value="";
document.registerForm.id.focus();
}
clearFocus("textName")用上面的两种方法都取不到,报错误--对象不支持此属性或方法说明,不用document.getElementById(id).focus(); 的方式, 因为该页面其它表单有同名id
所以必须用表单名定位.
//eval("document.registerForm."+id+".value")="";
//eval("document.registerForm."+id+".focus()");
document.registerForm.id.value="";
document.registerForm.id.focus();
}
clearFocus("textName")用上面的两种方法都取不到,报错误--对象不支持此属性或方法说明,不用document.getElementById(id).focus(); 的方式, 因为该页面其它表单有同名id
所以必须用表单名定位.
document.registerForm.elements[id].focus();
}如果同一个form的控件有同名
document.registerForm.elements[id][0].focus();