当前位置: 代码迷 >> Java Web开发 >> 关于html:form.focus的有关问题
  详细解决方案

关于html:form.focus的有关问题

热度:94   发布时间:2016-04-17 16:32:01.0
关于html:form...focus的问题
为什么控件是nested:text开头,焦点就置不上去,有什么解决办法吗?前提是用html:form的focus
<html:form   method= "post "   focus= "TXT_NAME ">
<nested:text   property= "TXT_NAME "   maxlength= "8 "   tabindex= "1 "   size= "40 "   />
而html:text开头,焦点就能置上去
<html:form   method= "post "   focus= "TXT_NAME ">
<html:text   property= "TXT_NAME "   maxlength= "8 "   tabindex= "1 "   size= "40 "   />

------解决方案--------------------
不懂 帮你顶
------解决方案--------------------
不用html:form的focus的话,可以用下面的方法试试:
<script language= "Javascript ">
function setFocus(){
document.getElementById( "TXT_NAME ").focus();
}
</script>

<body onload= "setFocus(); ">
<nested:text property= "TXT_NAME " maxlength= "8 " tabindex= "1 " size= "40 " />
  相关解决方案