SEM Labs

Handcrafted Pixels, Code & Title Tags

Creating A Form

XFL

Creating a working form using XFL requires two components: an XFL document and a controlling class. The XFL document gives instructions to the controlling class on how it should be displayed and how field values should be handled. The controlling class extends the XFL class and handles how an individual form should be processed.

Creating an XFL Document

As covered in the syntax section, XFL forms are the same as regular HTML forms. The only difference is XFL forms contain XFL elements. To create an XFL document, you need to use the schema defined in the syntax section. Within that, you create a HTML form as you would otherwise. Adding XFL elements to an XFL form is not required. They can be used as desired. See the XFL elements documentation to find out more about using XFL elements. Below is an example XFL document that will be used throughout the rest of the documentation.

Creating a Form Controller

XFL documents don't do anything on their own. They require a controlling class to parse them. To create a controller for a specific form, you need to create a class for it. Below is an example controller that will be used throughout the rest of the documentation.

Result

The result of providing the example form to the above class would result in:

To see examples of working XFL forms, see the demos page or download the latest release.