# \*WEB/UTIL: HTML Coding Utility

> Source: https://manual.pvxplus.com/web-server-reference/setting-up-pxplus-web-server/pxplus-web-server-utilities/html-coding-utility

## Description

The Web Server's **\*web/util** program may be called to simplify your coding when you build your HTML pages in PxPlus applications.

The **\*web/util** program contains miscellaneous routines to put various HTML codes into the **[%print_fn](https://manual.pvxplus.com/web-server-reference/setting-up-pxplus-web-server/pxplus-web-server-variables/overview#print_fn)** data channel for you. This is a called program with various entry points and various ENTER argument lists.

The table below contains a list of formats for the various entry points with arguments and descriptions of the codes that are added to **%print_fn**.

| **To Add to $print_fn** | **\*web/util**<br>**CALL EntryPoints** |
| --- | --- |
| 1\. Begin HTML | CALL "\*web/util;BEGIN_HTML",*title$*<br>Adds HTML code starting with the \<html>\<header> tag and going through to the \</header>\<body> tags. Adds *title$* value as a page title. |
| 2\. Closing Sequence | CALL "\*web/util;END_HTML"<br>Adds the closing sequences \</body>\</html>. Auto-closes any of the following:<br>Links set by BEGIN_LINK  <br>Paragraphs set by NEW_PARA  <br>Forms set by BEGIN_FORM |
| 3\. Begin Link | CALL "\*web/util;BEGIN_LINK", *url$*<br>Puts in a link and anchor tag for the given *url$*. |
| 4\. End Link | CALL "\*web/util;END_LINK"<br>Adds closing the anchor tag. |
| 5\. Begin Font | CALL "\*web/util;BEGIN_FONT", *name$, pt_size*\[,*bold*\]<br>Adds the begin_new_font tag for your given font name and point size. Bold is a Boolean value: **0** if omitted; **1** if included. |
| 6\. End Font | CALL "\*web/util;END_FONT"<br>Adds the closing tags to end the font tag created by BEGIN_FONT. |
| 7\. Begin Form | CALL "\*web/util;BEGIN_FORM", *form_name$, url$*<br>Closes a previous paragraph and form (as necessary) before creating a new form. Creates a new form tag with the given form name, links by POST to the given *url$*. |
| 8\. End Form | CALL "\*web/util;END_FORM"<br>Adds the closing tags for paragraph and form (as necessary). |
| 9\. Input Field | CALL "\*web/util;INPUT_FIELD", *field_name$, size*<br>Creates an input field ("TEXT" type) with *field_name$* and width. |
| 10\. Input Required | CALL "\*web/util;INPUT_REQD_FIELD", *field_name$, size*<br>Same as INPUT_FIELD but puts in validation code for field_name$!=null. |
| 11\. Input Area | CALL "\*web/util;INPUT_AREA", *field_name$, cols, lines*<br>Creates an input field ("TEXTAREA" multiline type) with the given number of columns and rows. |
| 12\. Submit Button | CALL "\*web/util;SUBMIT_BUTTON", *text$*<br>Creates a submit_action button for a form. The *text$* is the button's description. |
| 13\. Reset Button | CALL "\*web/util;RESET_BUTTON", *text$*<br>Create a reset_action button for a form. The *text$* is the button's description. |
| 14\. New Paragraph | CALL "\*web/util;NEW_PARA"<br>Creates a new paragraph tag (and closes a pre-existing one as necessary). |
| 15\. Program List | CALL "\*web/util;LIST"<br>The utility lists itself to the %print_fn channel. |

## Format

***Basic Call:***

```
CALL "*web/util;entrypoint", required_arguments
```

***Where:***

|  |  |  |
| --- | --- | --- |
|  | *entrypoint* | Entry point (line label) where execution in the \*web/util subprogram starts for the given routine. |
|  | *required_arguments* | String or numeric variable name. For each entry point of the utility, there are different argument lists. Refer to above table. |
