JSP中给文本框复制

jsp

 1 <form id="addEmployee" method="post"
 2             style="margin-left: 55px;margin-top: 10px;margin-bottom:10px">
 3             <input type="hidden" id="empid" value="" colName="colName">
 4             <table>
 5                 <tr>
 6                     <td colspan="2"><input type="hidden" id="pktg" />
 7                     </td>
 8                 </tr>
 9                 <tr>
10                     <td align="right">所属机构:</td>
11                     <td><input id="organame" colName="colName" /> <input
12                         type="hidden" id="orgacode" colName="colName"></td>
13                 </tr>
14                 <tr>
15                     <td align="right">柜员编号:</td>
16                     <td><input id="empcode" colName="colName" /></td>
17                 </tr>
18                 <tr>
19                     <td align="right">柜员姓名:</td>
20                     <td><input id="empname" colName="colName" /></td>
21                 </tr>
22                 <tr>
23                     <td align="right">柜员等级:</td>
24                     <td><!-- <input id="empLevelName" colName="colName" /> <input
25                         type="hidden" id="empLevel" colName="colName"> -->
26                         <select id="emplevel"  >  
27                             <option value="1">一级柜员</option>  
28                             <option value="2">二级柜员</option>  
29                             <option value="3">三级柜员</option>  
30                             <option value="4">四级柜员</option>  
31                             <option value="5">五级柜员</option>  
32                         </select><input id="emplevelname" type="hidden">  </td>
33                 </tr>
34             </table>
35         </form>


<script>

 1 var getSlectedata = $("#employeeGrid").datagrid('getSelected');
 2             if (!getSlectedata) {
 3                 $.messager.alert('温馨提示',"请选中职工!","info");
 4             }
 5             var saveObj = {};
 6             $("input[colName=colName]").each(function() {
 7                 var propertites = $(this).attr("id");
 8                 var val = getSlectedata[propertites];
 9                 saveObj[propertites] = val;
10                 $(this).val(val);
11             });

 

posted @ 2014-02-24 10:33  侯晓鹏  阅读(767)  评论(0编辑  收藏  举报