现在我想用javascript读取search.php   <td></td>中的值,并在index.php文件的输入框中显示,请问怎么写这段Javascript?就算你在td里加个id属性,那个id的值是不确定的!因为这个id的值是数据库ID里的值,是循环从数据库里读取出来的!
index.php文件代码:
<html>
<head></head>
<body>
<form id="form1" name="form1" method="get" action="search.php" target="result">
</label>
重量:
<label>
<input name="weight" type="text" id="weight" size="7" />
</label>
<input name="<?php echo $_SESSION['user']['username'];>" type="hidden" id="$_SESSION['user']['username']" />工号:
<label>
<input name="employeeID" type="text" id="employeeID" size="7" onchange="getEmployeeInfo()" />
</label>
姓名:
<label>
<input name="employeeName" type="text" id="employeeName" size="7" />
部门:
</label>
<label>
<input name="department" type="text" id="department" size="7" />
职位:
</label>
<iframe name="result" src="" width="100%" height="100%" frameborder="no" border="0" marginwidth="0" marginheight="0" scrolling="yes" allowtransparency="yes"></iframe>
</body>
</html>
search.php文件代码:
      <td><?php echo $recordInfo['friqi'];?></td>
      <td> <?php echo $recordInfo['huoxing'];?> </td>
      <td><?php echo $recordInfo['fzhongliang'];?></td>
      <td><?php echo $recordInfo['operator'];?></td>
      <td><?php echo $recordInfo['gonghao'];?></td>
      <td><?php echo substr($recordInfo['sriqi'],0,9);?></td>