Ajax textfield in hook_form_alter
You can use simple jQuery to achieve this then. Try putting the following code in your JS file: 

$("#fname").blur(function(){
  var fname = $("#fname").val();
$("#lname").val(fname);
});