<logic:iterate  id="search" name="MS3080Form" property="searchList" >
<tr >
<!-- <td align="center"><input type="checkbox" name="b"  value="<bean:write name="search"  property="userId"/>"/> </td>-->
<td width="61" align="center"><html:hidden name="search"  property="userId"/>
<!--onclick ="tong('<html:hidden name="search"  property="userId"/>','<bean:write name="search"  property="realName"/>','<bean:write name="search"  property="pHone"/>' )" -->
<bean:write name="search"  property="realName"/></td>
<td width="115" align="center"><bean:write name="search"  property="pHone"/></td>
</tr>
</logic:iterate>页面显示  USERID   USERNAME   PHONE
             1       赵1      150.....
             2       赵2      158.....
             3       赵3      158.....
             .        .          .
             .        .          .
             .        .          .??????  点击一条数据 分别添加到下面3个TEXT框里 , 用js 大侠帮忙啊!!!!页面有3个text框如下:<html:text name="MSForm"  property="USERID   "/>
<html:text name="MSForm"  property="USERNAME   "/>
<html:text name="MSForm"  property="PHONE "/>这3个text框和上面从数据库取出的数据是一个页面

解决方案 »

  1.   

    使用jQuery能方便的对DOM进行操作,将会使你十分方便的实现
      

  2.   

    tong('<html:hidden name="search" property="userId"/>','<bean:write name="search" property="realName"/>','<bean:write name="search" property="pHone"/>' )" 在JS里写这个方法啊
    function tong(userId,realName,pHone) {
      form.USERID.value = userId;
      form.USERNAME.value = realName;
      form.PHONE.value = pHone;
    }
      

  3.   

    如果数据量很大的话可以用ajax拿着这条数据的Id再去读一次数据,然后在给几个文本框赋值这样比较好一点哦! 因为要考虑到页面加载效率的问题,毕竟你不是一定会每条数据都去点啊!对吧!只有点到了在去读这样就会给页面上的显示减少很多冗余的数据了,对吧!