This page describes the workspace 1 Html which provides nouns and verbs to design, display, and test web pages from the APL development environment. There is also Run.html which allows you to host your web pages without the users having to learn APL. In addition to creating the page layout and the handling of events in fields, there are also tools to save information for subsequent processing.

When you click on Demo, you will see a page with seven labels, eight ordinary text boxes, one multi-line text box, four check boxes and one drop down list box. Additionally, there are buttons labeled:

Load fills the text fields with random numbers
Clearresets all the fields
Savesaves the current field values, which will be displayed then next time you try the application
#Debug evaluates an APL expression, useful to test verbs which
are only useful inside a web page

The eight Text fields log what happens as you type. Additionaly, a sample noun "newList" is provided to demonstrate rewriting the content of fields such as a listbox.

then typenewList

then look into the drop down list box to see what happened.

To begin learning how this works, either download and install
or just click on the web version:

then enter )fetch APL/Demo
then enter)load testHtml
then enter)edit

Look at the noun Example to learn how the screen was created. There are three reserved noun names which the web page calls:

onDefine is called to provide the HTML fields. Verbs to access
attributes of fields are not available until onLoad is called.
onLoad runs before the user has access. This provides
an opportunity to initialize fields
onUnload runs when the form in unloading. This provides an
opportunity to save fields.
Unfortunately not all browsers call this event,
so pressing a Save button is more reliable.

Much of the functionality is provided by the initial line
   #include Html
To learn what that does:
   )load 1 Html

First look at the verbs which create each type of field:

Button 'Visual Label'
Text1 number (which defines size)
2 numbers (which defines rows and cols)
Check'pair' 'Label Pair'
List('pair' 'Label Pair') ...
Handle'idName' 'onCondition:yourHandler'
transforms left arguments for any of the above, this
verb is not called directly by users. If only one value
is provided, the presence of ":" identifies what it is.
On conditions are defined by Javascript,
but handlers do not have reserved names.
Table turns a matrix into an HTML table.
Every field verb creates a scalar result, which makes
putting them together as a matrix easy.

The following verbs get or set fields with the ID right argument:

Values returns "value" from fields,
or with a left argument, sets a new value or values.
Checks returns "checked" as booleans from fields
or with a left argument, sets the checked state.
Defines returns "innerHTML" from fields,
or with a left argument, sets the innerHTML.

Inside an event handler, the following verbs get or set an attribute:

Field returns an attribute (like 'value') of the current field,
or with a left argument, sets the attribute
Event returns an attribute (like 'keyCode') of the current event
or with a left argument, sets the attribute
I'm not sure you can assign an event attribute,
this is for completeness.

In the demo testHtml, the eight Text fields call "sampleEvent" in the onkeypress event. That noun prepends the log of events to the multi-line Text field at the bottom of the form.

If you make any changes, to test their effect:

First type)save testHtml
then typego

Once you are ready to release your web page:

First type)load 1 Host
then typeSave 'testHtml'

Then move the file testHtml.jsa to the directory
which you must create in the same directory where you put APL.js.

To publish your product on the web, put both APL.js and your APL.js.User files where people can access them. Then provide a link to: