Not able to fetch value for edit Data Modal Form, from db through json data response

Not able to fetch value for edit Data Modal Form, from db through json data response

i need to fetch specific data from database and to be show in modal form ( Update / Edit Form ) , for i.g in form elemen i have this : 
  1.  <div class="form-group">  
  2.     <label for="nama" class="col-sm-2 control-label">Nama</label>
  3.          <div class="col-sm-10">
  4.      <input type="text" class="form-control" id="name" name="name" >
  5.         </div>
  6.  </div>
then function event onclick button submit .
    1. function editEmploy(id = null) {

    2.     if (id) {
    3.         //fetch data
    4.         $.ajax({
    5.             url:'pegawai/editpeg.php',
    6.             type:'post',
    7.             data:{'nip': id},
    8.             dataType:'json',
    9.             success:function(response) {
    10.                 $("#nama").val(response.name); // Not showing anything at modal form
    11.                  alert(response.name); // its shown name from database  
    12.             }
    13.         });
    14.         
    15.     }else{
    16.         alert("ERROR : blah ..blahh");
    17.     }
    18. }
    if i test with alert , it will show information data name from database , its mean fetching data from database have done well. How to send it to  <input type="text" class="form-control" i d="name" name="name"  >

    i have tried with this 
    1. $("#name").val(response.name); 
    but when  modal form show the input type shown anything / blank , no value , how to do this ? i mean send the value from response ajax to input type elemen form ?