Log In    |    Knowledge Base    |    4D Home
Tech Tip: Including custom HTML code in 4D web forms
Published On: August 5, 2000
Your current browser may not allow you to download the asset. We recommend Mozilla Firefox or Google Chrome.
Log In

There are three ways in which you can encapsulate HTML code into your 4D application in order to customize the look of your forms:

1. Using the command SEND HTML FILE, you can send a Web page stored on disk.

2. A 4D form static text object, such as "{anyPage.HTM}", inserts the HTML document "anyPage.HTM" into the 4D form at the location of the static text object (note the curly braces).

3. Any 4D text variable in a form can encapsulate HTML code into a 4D form, provided its first character is ASCII code 1; i.e., vtHTML:=Char(1)+"...HTML code...".

In the last two cases, the resulting form on the Web brower side is the combination of the 4D and HTML objects. Note that when using a static text object, you insert a document in its entirety. When using a text variable, you insert pieces of code. Using SEND HTML FILE or form static text object, you can either use an existing HTML document or refer to a document that you have programmatically built and then saved on disk. You can build the HTML code in memory, using a text variable located in a form.