I want to autofill two input elements bi clicking on a link. Here is the code I'm using:
<script>
function autoFill(depart_from, depart_to) {
document.getElementById('depart_from').value = depart_from;
document.getElementById('depart_to').value = depart_to;
}
</script>
And here is the link:
...
echo "<tr class='odd'>";
echo "<td><span class='hover'><ahref='#'onClick='autoFill(" . $row['departure'] . ", " . $row['destination'] . "return false;'>" . $row['departure'] ." » ". $row['destination'] . "</a><span></td>";
echo "</tr>";
Can't get it to work! What am I doing wrong?
Thanx!