KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Embedding an HTML Link in a 4D Form
PRODUCT: 4D | VERSION: | PLATFORM:
Published On: July 28, 2000

This tech tip describes one method for creating a link in a 4D form. To make things a little bit more interesting and complex, the link described below displays, in a new browser window, data sent through SEND HTML FILE.

<B><A HREF="https://MyIPAddress/4DMETHOD/Send_File"target="_blank">

Language Reference</B>

Where:
- MyIPAddress is the address of the server (it could replaced by the name of the Web site)
- 4DMETHOD/Send_File is the call to the Send_File method

In this case it could be as simple as:
SEND HTML FILE("MyFile.HTM") where MyFile.HTM is an HTML document located at the same level as the structure of the database.

- target="_blank" sets the target window as a new blank window
- Language Reference is the text of the link (in Bold)

For you to be able to place that link in the form, you need to:

1. Create a text variable
2. Set it to non-enterable
3. When the On load event is executed, assign it a text string that begins with Char(1) followed by the HTML definition of the link:

Cut and Paste the following code example into your own 4D project
Case of: (Form event=On Load )
vText:=Char(1)+"Language Reference"
End case
In this example we used the loopback IP address (127.0.0.1).