I have these codes:
testing.php
<html>
<head>
<script type="text/javascript">
function copy_data(id){
var a = document.getElementById(id).value;
document.getElementById("copy_to").value=a;
}
</script>
</head>
<body>
<form action="testprocess.php" method="post">
<input type="text" name ="a" id="copy_from" onkeyup="copy_data('copy_from')"/>
<input type="text" value=0 name ="b" id="copy_to"/>
<input type="submit">
</form>
</body>
</html>
testprocess.php
<?php
$test = $_POST['copy_to'];
echo $test;
?>
I get an error saying that 'copy-to' is an undefined variable. Can you please tell me why?
Thanks.