ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

This content has been translated automatically.  Click here  to view the French version.
Help / Developing an application or website / Controls, windows and pages / Controls: Available types / Edit control
  • The HTML format
  • HTML Edit control
  • Overview
  • Control characteristics
  • WLanguage events associated with the control
  • Defining the content of an HTML Edit control
  • Saving a text in an HTML file
  • Example
  • Saving HTML text to an HFSQL data file item
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
The HTML format
HyperText Markup Language (HTML) is a markup language intended for the web.
WEBDEV allows you to manipulate text in HTML via the "HTML format" option of the Edit controls and the HTML control.
  • If the HTML text is displayed in a control that does not support HTML, the tags will be displayed.
  • If the HTML text is displayed in a control that supports HTML, the tags will be automatically interpreted and the text will be formatted accordingly.
HTML Edit control

Overview

The HTML Edit control is used to:
  • display HTML content,
  • enter HTML content.
The control automatically stores entered text as HTML. This text will contain all the necessary formatting tags.

Control characteristics

The HTML Edit control has several options ("General" tab in the description window):
  • HTML toolbar: A formatting bar can be displayed above the Edit control.. This toolbar allows the user to easily format the text entered. For more details, see HTML formatting toolbar.
  • Action on the Enter key: Defines the function of the Enter key used in the HTML Edit control..
  • Email editing: Offers an "email" input mode that limits HTML functionalities to those recognized by the majority of email readers.
  • Content independent of page style: Applies only the style defined for the input part of the Edit control.. No other style will be applied to the text in the input field.
Remark: If you enter the same text in a classic edit control and in an HTML edit control, the size of the string in the edit control will be larger than in the HTML edit control (because HTML tags are added).

WLanguage events associated with the control

The HTML Edit control includes all the WLanguage events associated with Edit controls. For more details, see Events associated with Edit controls.
The optional "Key down" event, available in browser code, allows you to create shortcuts using F keys, etc.
Defining the content of an HTML Edit control
To define the content of an HTML Edit control, simply specify the Value property (in the initialization code of the control, for example).
For example:
// Lecture d'un fichier HTML
PageHTML is string
PageHTML = fLoadText(SysDir(srMyDocuments) + ["\"] + "index.html")

// Initialisation du champ de saisie
SAI_ChampHTML = PageHTML
Saving a text in an HTML file
HTML formatting is automatically applied to the text entered in an HTML Edit control.
To save the content of an HTML Edit control to an HTML file, simply use fSaveText on the control.

Example

The example below creates an "index.html" file. This file contains the text entered in the Edit control field SAI_TexteHTML.
// Sélection du chemin et du nom du fichier
Nomfic is string
Nomfic = fSelect("", "", "Sélectionnez un fichier...", ...
		"Fichiers HTML" + TAB + "*.html" + CR + "Tous fichiers (*.*)" + TAB + "*.*", ...
		"HTML", fselCreate + fselExist)

// Enregistrement
fSaveText(Nomfic, SAI_TexteHTML)

Saving HTML text to an HFSQL data file item

To save HTML text to a data file item, it is recommended to bind the Edit control to a Text Memo item.
As HTML includes many tags, "Character string" items are often too small.
Minimum version required
  • Version 15
Comments
Click [Add] to post a comment

Last update: 09/21/2024

Send a report | Local help