Add a Form to the template.
The template needs to know what form it is associated with. This is accomplished with the Form: Field.
The Form Field must:
Form: hello-form.htmlUse <var> Tags to capture data sent from a Form so it can be stored in the Message.
Tags in the example hello-form-template.txt are used to put data into the message:
To: Field.Msg: Field.In more complex Forms, other Fields like Subj: can accept Form data, and additional Tags can be strung together to represent complex data captured by a Winlink Form.
HTML is the language of document structure:
<form> and <div> which define various parts of the page.Recommendation: Stick to the format provided in this example to simplify learning HTML and Winlink Forms.
An HTML Page is called a Document:
All HTML elements must be opened and closed. Many HTML elements also have properties called attributes which define specific capabilities of the element.
Opening an HTML element, adding content, then closing the element:
<p>Hello World!</p>
Some elements can be closed without adding content, such as input elements:
<input type="submit" name="Submit" value="Submit" />
Rule of thumb: If the element displays content, be sure to use a closing tag after the content, otherwise add / to the end of the tag to “self close” it.
Elements are defined in part by “attributes”. They are the properties of elements.
One attribute, ID is special in that only one ID value can exist within an entire HTML document. The idea is to allow other frameworks and processes to “target” the element by its ID to do things like:
Type, Name, Value, and Class are a few of many other attributes that can be set.
A Winlink Form will not operate as intended without the following HTML elements:
<form>: Must have an ID that you can name as you wish, and the attributes post, action, and enctype exactly as defined in hello-form.html<input>: Must have attribute type="submit" and (by convention) have attributes name="Submit" value="Submit" (note the case-sensitivity).For every Winlink Form you create, ensure the following things are included:
<Form> element has these attributes: method="post" action="http://{FormServer}:{FormPort}" enctype="multipart/form-data".<Form> element has a unique id, named to your preference. For these exercises, just use “RMS_Express_form”.<input> element has these attributes: name="Submit" value="Submit".You can optionally add class and/or id attributes to the <input> element, but they are not required for Winlink Form functionality.
Everything else is optional! Depending on the goals of your form, you can add many other elements with id, class, and other attributes.
<form> element, add some <input type="text"> elements so a user can input data.input element with the name attribute that matches an existing Tag.<input> element’s name attribute with existing var Tags, and copies the data from the Form to the message.There are many more input types that you can use to get information from the user:
For now, these Modules will stick with “button” and “text”.
A read-only element. Give it a for="" and set a value that describes the purpose of the input element with the same name="" attribute:
<label for="tocall">Enter recipients callsign:</label>
<input type="text" name="tocall" />
The Form Element does a lot of work under the hood. Think of it as a box around labels and inputs that, when the “submit” button is clicks, deals with the dirty work “submitting” the form data to where it needs to go.
Put files into Winlink Express Global Folders\Templates directory:
hello-form-template.txthello-form.htmlhello-form-template.txt in the Global Templates (or callsign) directory.hello-form.html.Move on to Module 3 - Form Functionality
Return to Root README