Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help with THTTPServer
#5
(02-04-2020, 05:09 AM)andym2 Wrote: On the server at Submit I receive the 3 data fields, and process their data. I now want to send back data to those 3 fields for display to the user.

Is the webform being submitted to your server through a normal web post (ie, the user clicks the button, and the browser directly submits it), or is it being submitted via client-side AJAX scripting (the XMLHTTPRequest object, etc)? Or though some other means?

If the former, then send back the same HTML page containing the same webform, just with the HTML <input> fields filled in with the desired values as needed. <input> fields have attributes in their HTML for that purpose.

If the latter, then send back a JSON document containing the desired values, and let the client-side AJAX scripting parse the JSON and populate the existing webform fields via the browser's DOM interfaces as needed.

(02-04-2020, 05:09 AM)andym2 Wrote: I had expected there to be something like the RequestInfo.Params in the ResponseInfo structure, where I can set the new field data and send back to the Client.

No, because that is not how HTML and HTTP interact with each other.

(02-04-2020, 05:09 AM)andym2 Wrote: What am I missing here?

An understanding of the relationship between client-side technologies (HTML, AJAX, etc) and how they use HTTP to send and receive data. When sending data to a server, HTTP definitely defines how webform data should be posted. That is why the ARequestInfo.Params property can exist. But there is no single definitive way to send data back to a webform on a client, which is why there is nothing provided in AResponseInfo for that specific purpose.

Reply


Messages In This Thread
Help with THTTPServer - by andym2 - 02-03-2020, 10:19 AM
RE: Help with THTTPServer - by Robert Gilland - 02-03-2020, 10:28 PM
RE: Help with THTTPServer - by rlebeau - 02-04-2020, 12:52 AM
RE: Help with THTTPServer - by andym2 - 02-04-2020, 05:09 AM
RE: Help with THTTPServer - by rlebeau - 02-04-2020, 10:12 PM
RE: Help with THTTPServer - by andym2 - 02-04-2020, 10:45 PM
RE: Help with THTTPServer - by rlebeau - 02-06-2020, 01:12 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)