formTemplate
Provides the ability to gather information from the user.
Overview
Use the formTemplate element to gather information from the user; for example, requiring a password to access your app. The banner area can contain an image and a description of your product. The user enters text in the text field directly below the banner using the automatically generated keyboard. Use the footer area to contain any user interaction buttons. The following figure shows the basic layout for a formTemplate page. The theme for the form template defaults to the system preference.
[Image]
Form Template
The following listing shows the main elements of the formTemplate element in TVML format.
<formTemplate>
<background>
…
</background>
<banner>
<img />
<description>…</description>
</banner>
<textField>…</textField>
<footer>…</footer>
</formTemplate>Element Descriptions
- background
Only accepts
imgandheroImgelements in the background.- banner
Information displayed along the top of the screen that is typically used to provide instructions to the user.
- description
The text used to describe what the user needs to enter.
- footer
Information displayed along the bottom of the screen, such as a Submit button for the user to commit the information entered in
textField.- img
An image of the product.
- textField
User input field.
Example
The following listing shows the TVML for a formTemplate example. The interactive keyboard is automatically created. The footer area contains a button that can submit the user input. Modify your main JavaScript file to accept the user input from the button. For more information on available JavaScript functions, see TVMLKit JS.
<document>
<formTemplate>
<banner>
<img src="path to images on your server/Car_Movie_800X400.png" width="800" height="400"/>
<description>Enter email for access</description>
</banner>
<textField>tclark@example.com</textField>
<footer>
<button>
<text>Submit</text>
</button>
</footer>
</formTemplate>
</document>The following figure shows the output for the above example:
[Image]