The programming needs to be inside the PDF (Has always been that way for almost 3 decades)
Then the button sends the data as designed by you, to your server.
So here I am E.T. and phoning home.
This was done in seconds by adding a GUI button as text.
For a simple method see my previous answer https://stackoverflow.com/a/78212967/10802527