• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 20. XForms and CFML > What is XForms?

What is XForms?

So what exactly is XForms? XForms is an XML grammar in which you can define a form. It is separated into three parts: data (instance), display (control definition, and binding), and action (submission). Looking at a typical HTML form, we have a form tag that defines its action, which is where the form submits to. In XForms, submitting a form can do different things—submit to an HTML page, copy a file, or other things. This is the “submission” part of XForms. You then define the form controls, which define the display elements. In more general terms, what you are actually defining is what types of decisions the user can make—for example, “choose one of these options” (a radio button or single select) or “submit the form now” (an image or submit button.) In addition, using “value=”, selected, checked, and embedded textbox text defines the values that these controls initially have. Since XForms separates the data from the display, those values are defined in the “data” section of XForms and the controls and what data is displayed in them is defined in the “bind”, or controls section (which data is bound to which control).

Once XForms defines the information in XML, your browser still can't display it—all your browser understands is HTML. Therefore, it requires both an XForms XML document and something that translates it into HTML. HTML (or at least, the better formed version of it, XHTML) is an XML grammar, so this is accomplished using XSLT, which means eXtensible Stylesheet Language Transformations. XSLT defines transformations that you can use to define how to translate an XML document into another XML document. XSL is the language that is used by XSLT to define these transformations, so in order to have a complete system you'll need both an XForms form definition and an XSL document that describes how to translate that forms definition into something displayed. We'll see in this chapter how ColdFusion creates XForms, and how it uses XSL to render them.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint