Can I do this using PHP?
Consider
<html>
<head>
<title>txt with js eff</title>
</head>
<body>
<script type = "text/javascript">
function transfer(which) {
document.getElementById("temp_name").value = which;
}
</script>
<form action="" method="post" name="frm1">
<label> In put 1 </label>
<input
type="text"
name="username"
id = "username"
onkeyup = "transfer(this.value)"><br/><br/>
<label> In put 2 </label>
<input
type="text"
name="temp_name"
id = "temp_name">
</form>
</body>
</html>
I need to do this using PHP:
I need to pass the value " Insert 2 " from " Insert 1 " when the user directs his cursor to the next field. I can do this very easily with JavaScript, but I need it with PHP.
Is there a solution?
Perhaps you want to keep the values. Just call the submit method after making changes to JavaScript, and then save it in the database or in the session or whatever. Or maybe you can make an Ajax request to avoid page reloading, but it's really hard to understand what you are trying to achieve or understand.