我需要使用相同的 javascript 函数填写工作的代码和姓名缩写。java脚本函数
<script type="text/javascript">
function Expedisi(t) {
var y = document.getElementById("code");
y.value = t.value;
}
</script>
<tr>
<td width="200px" align="right"><label for=""><font color="0099FF"size="3px">Code</font><span></span></label></td>
<td align="left"><input type="text" id="code" name="code" value=" <?php echo ($addflag == 0) ? $get['loan'] : ""; ?>" class="form-input-code" readonly />
</tr>
<tr>
<td width="200px" align="right"><label for=""><font color="0099FF" size="3px">Employee Name </font><span></span></label>
</td>
<td align="left"><select data-placeholder="Employee Name" style="width:332px;" id="cmbemployee" name="cmbemployee" class="chzn-select-deselect" onchange="Expedisi(this)""/>
<option value="<?php echo ($addflag == 0) ? $gete['accode'] : ""; ?>"><?php echo ($addflag == 0) ? $gete['name'] : ""; ?></option>
<?php
$mown = mysql_query("SELECT * FROM accmast WHERE grpcode='044'") or die(mysql_error());
while($trow = mysql_fetch_array($mown))
{
echo "<option value=$trow[accode]>$trow[name]</option>";
}
?>
</select>
</td>
</tr>