javascript - Filling two textbox with the same functions in php -
i need fill code , initials of employment same javascript functions. java script function
<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 * accmast grpcode='044'") or die(mysql_error()); while($trow = mysql_fetch_array($mown)) { echo "<option value=$trow[accode]>$trow[name]</option>"; } ?> </select> </td> </tr>
you can no value of select element in js!
<script type="text/javascript"> function expedisi(t) { var y = document.getelementbyid("code"); y.value = t.options[t.selectedindex].innerhtml } </script>
Comments
Post a Comment