I need to run javascript code from a PDF to post data to an HCL Leap application. Is there anyway in which I can use xmlhttprequest within adobe, or does anyone have a suggestions on modifying to ajax or similar?
Tried having the javascript install npm install xmlhttprequest
var XMLHttpRequest = require("xmlhttprequest").XMLHttpRequest;
var xhr = new XMLHttpRequest();
var jp = {};
jp.flowState = 'ST_PendingPDFupload';
jp.pressedButton = 'S_Submit1';
jp.F_Value1 = this.getField("F_Value1").value.toString();
var s = JSON.stringify(jp); //covert to string to send in XHR
var UID = this.getField("UID").value.toString();
var urla = 'https://domain/forms-basic/secure/org/data/ba48a093-5a1d-40ef-
87f6-bb196b95fa9f/F_NewForm1/'
var urlb = '?freedomIdentifyKey=XX'
var url = (urla + UID + urlb)
var client = new XMLHttpRequest(); //open an HTTP request
client.open("PUT",url,false);
client.setRequestHeader('Content-Type', 'application/json');
client.setRequestHeader('Accept', 'application/json');
client.setRequestHeader('Cookie', 'freedomIdentifyKey=XX');
client.send(s);
ReferenceError: require is not defined