Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help with THTTPServer
(02-04-2020, 10:45 PM)andym2 Wrote: I think we are getting closer. You are correct this is just a normal web post, no scripts, AJAX or anything.

Then, you can pretty much send back whatever you want, and the browser will display it. Send HTML, plain text, JSON, it is really up to you. It sounds like you probably want HTML, though.

(02-04-2020, 10:45 PM)andym2 Wrote: So after my processing I can call a ResponseInfo.ServeFile(AContext, 'testform.html'));. When I do the client screen is displayed but with the fields all blank.

You could do that, but you would have to alter the HTML after each post to fill in the webform fields with your desired values.

(02-04-2020, 10:45 PM)andym2 Wrote: I want to send back to the client "Field1=ABC". "Field2=XYZ" and "Field3=1234".

Then you have to send back HTML that has been altered after each post. For example, instead of sending a static HTML file containing:

<input type="text" name="Field1">
<input type="text" name="Field2">
<input type="text" name="Field3">

You would have to send a dynamic HTML text containing instead:

<input type="text" name="Field1" value="ABC">
<input type="text" name="Field2" value="XYZ">
<input type="text" name="Field3" value="1234">

(02-04-2020, 10:45 PM)andym2 Wrote: So where are the HTML <input> fields you refer to?

Inside the .html file you are sending to the client. In that file, there is a <form> element that tells the web browser where to submit the webform to. Non-empty <input> fields inside that <form> are what get submitted by the web browser to your server.

(02-04-2020, 10:45 PM)andym2 Wrote: I'm guessing they are somewhere in the AContext or ResponseInfo structures

No, they are not. They are in the HTML data you are sending back to the client. Sounds like you need to read up more on how HTML webforms actually work.

(02-04-2020, 10:45 PM)andym2 Wrote: how do I set, in this example, the 3 data pairs?

See above.


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)