Hi there,
bit quick and dirty, but this should do what you want:
HTML Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>onblur example</title>
<script>
function test(){
var f1 = document.getElementById("username_input");
var f2 = document.getElementById("username_input2");
f2.value = f1.value;
}
</script>
</head>
<body>
<input type="text" name="usermame" id="username_input" value="Field 1" onblur="test()"><br /><br />
<input type="text" name="username2" id="username_input2" value="Field 2">
</body>
</html>
Inline JavaScript is not the best practice however, so it might be worth considering using an event listener.
Bookmarks