Navigate to an External URL and post data

I’m trying to pass control from my web application to a 3rd party application. The 3rd party application is expecting data to be posted to it. How do I do this in Xojo?

I can do this with an HTML page like this:

So clicking the “Submit” button will navigate to the url and POST the data at the same time.

I don’t want to display the new URL in an HTML Viewer, I’m trying to pass control to the new application. I also don’t want to use a Query string as the actual data I am sending is sensitive.

Thanks in advance

Jim Brock

Ok, I’ve sorted it. You do it like this:

Dim Javascript() As String
Dim SJavascript As String

Javascript.Append (“var form = document.createElement(”“form”");")
Javascript.Append (“form.setAttribute(”“method”", ““post””);")
Javascript.Append (“form.setAttribute(”“action”", ““http://localHost:8000"”);”)

Javascript.Append (“var hiddenField = document.createElement(”“input”");")
Javascript.Append (“hiddenField.setAttribute(”“name”", ““SystemName””);")
Javascript.Append (“hiddenField.setAttribute(”“value”", ““EPR””);")
Javascript.Append (“form.appendChild(hiddenField);”)

Javascript.Append (“var hiddenField = document.createElement(”“input”");")
Javascript.Append (“hiddenField.setAttribute(”“name”", ““PASId””);")
Javascript.Append (“hiddenField.setAttribute(”“value”", ““5156017"”);”)
Javascript.Append (“form.appendChild(hiddenField);”)

Javascript.Append (“document.body.appendChild(form);”)
Javascript.Append (“form.submit();”)

SJavascript = Join(Javascript)

ExecuteJavaScript SJavascript

I do this on a Button.Action event.

Thanks

Jim