Please tell me how to POST the information entered by the user in a form to another site and open it

e_hazeyama
Tera Contributor

By writing the HTML as shown below, you can open a separate tab on the user's browser and post the information entered on the current page to another site specified in the separate tab. Could you please tell me?
I contacted NowSupport, but they said they didn't have an answer, so I was instructed to post it in the Community.
I was able to perform a similar operation using top.window.open() in a UI Action, but the method is GET and the request parameters are connected to the URL, so I am looking for a way to implement it using POST. .
[What I want to achieve]

<html lang="ja">
<head>
   <script language="javascript"> 
   function test() { 
      parent.winObj = window.open("about:blank", "subwin");
      document.currentForm.target = "subwin";
      document.currentForm.action = "https://www.othersite.co.jp/alignment.jsp";
      document.currentForm.method = "POST";
      document.currentForm.submit();
   }
   </script>

</head>
<body>
   <form name="currentForm"> 
      <input type="text" name="myName"> 
      <input type="text" name="myCity"> 
      <input type="hidden" name="curItem1" value="value1"> 
      <input type="hidden" name="curItem2" value="value2"> 
      <input type="button" value="GO" onclick="Javascript&colon;test();"> 
   </form>
</body>
</html>

 

If anyone has experience with implementation or knows how to implement it, please let me know.

0 REPLIES 0