I have a simple javascript function that shoud insert a value in the cell when the value in the dropdown list changes. Dnt knw the reason why its not working.
<script type="text/javascript">
function displaytaskid() {
var id=document.getElementById(dropdown).value;
document.getElementById(task_id1).value=id;
}
</script>
<td id ="task_id1"></td>
<td name = "task_id[]" id="dropdown" onchange="displaytaskid()" ><select name="task_id">
<option value=""></option>
<?php
while($lp_row = pg_fetch_assoc($res2))
{
$val = $lp_row["task_id"];
$caption = $lp_row["task_description"];
if ($row["task_id"] == $val) {$selstr = " selected"; } else {$selstr = ""; } ?>
<option value="<?php echo $val ?>"<?php echo $selstr ?>><?php echo $caption ?></option>
<?php } ?></select>
</td>
Many Thanks