how to change relationship form value

hi,All


I set "Open Related Form" on [relationshiptype] so that I can edit the relationship with a popup window when I click "Add Relationship".

But I want to bring out the default values in the popup window, I tried the following actions

//my code

//This is the code I tried to write in JavaScript

if ("" === this.getProperty("requ_name",""))
{
   var UserId = this.getInnovator().getUserID();
   if (UserId)
   {
      //User
      UserId = UserId.substr(0,32);
      var User = this.getInnovator().getItemById("User", UserId);
      if (User.getItemCount()==1)
      {
         this.setProperty("requ_name", User.getAttribute("id"));
         this.setPropertyAttribute("requ_name", "keyed_name", User.getProperty("keyed_name", ""));

         // The first way ,but it responds with this message { "undefined" : "document.getElementById(...) is null" }
         document.getElementById("requ_name").value = User.getProperty("keyed_name", "") ; 
         handleItemChange("requ_name", document.getElementById("requ_name").value);

         // Second way, but it responds with this message { "undefined" : "handleItemChange is not defined" }
         handleItemChange("requ_name", User.getProperty("keyed_name", ""));
         //document.thisItem.setProperty("requ_name", User.getProperty("keyed_name", ""));

         // The third way, but it responds with this message { "undefined" : "document.getElementsByName(...)[1] is undefined" }
         var vid=document.getElementsByName("requ_name")[1].id;
         document.getElementById(vid).value = User.getProperty(“ keyed_name”,“”); document.thisItem.setProperty(“ requ_name”,User.getProperty(“ keyed_name”,“”)));
               

      }

   }

}

Please advise me.

Thank you.