I would like to write in an input field with a PHP variable. This is the current code I have:
JS:
<script type="text/javascript">
function reply(form, inp){
form.texta.value = "@" + inp;
}
</script>
HTML:
<a href="#" onClick="reply(form1, <?php echo $poster; ?>);">Reply ^</a>
<form id="form1" name="form1" method="post" action="index.php"><input type="texta" name="texta" /></form>
This code however does not put the text of the variable in the input field. Sorry, I am a bit new to JavaScript.
Can anyone help me here?