AJAX is exactly the same as any regular HTTP Post/Get. Which is exactly what the submit does. So I assume what you really mean is you want the request body to contain JSON. Is this correct?
If so then the answer is Yes and No.
First the No, the form submit function only formats data in a few different ways. Here's the reference entry:
I've created a test script for it here (its not free):
Thank you very much, Thom, for an instant reply to the post. Although, I forgot to mention at first that I am naive to this and finding it very difficult to make it work. I am attaching a dummy function here. I want to make a POST request with data being sent from Acrobat and received by Web.api method that I have written. I want to also pass the data with the POST method.
The documentation of the request method clearly states:
Thank you try67. But sorry, I am not able to understand what you are trying to convey. I am pretty naive about this and finding it very difficult. I would be glad if you could elaborate.
It means that if you want to use this function you have to install a script on the local machine of each user who will open the file.
Oh. Got that! Thank you! 🙂
You can read about trust in Acrobat scripts here:
you can test your code from the console window, but this function will not run in the console window when a document is open.
There is a tutorial on the console window here: