Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
XForms
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Differences from web forms== In contrast to the original web forms (originally defined in HTML), the creators of XForms used a [[model–view–controller]] (MVC) approach. The model consists of one or more XForms models describing form data, constraints upon that data, and submissions. The view describes what controls appear in the form, how they are grouped together, and what data they are bound to. [[Cascading Style Sheets|CSS]] can be used to describe a form's appearance. An XForms document can be as simple as a web form (by only specifying the submission element in the model section, and placing the controls in the body), but XForms includes many advanced features. For example, new data can be requested and used to update the form while it is running, much like using [[XMLHttpRequest]]/[[Ajax (programming)|AJAX]] except without scripting. The form author can validate user data against [[XML Schema (W3C)|XML Schema]] data types, require certain data, disable input controls or change sections of the form depending on circumstances, enforce particular relationships between data, input variable length arrays of data, output calculated values derived from form data, prefill entries using an XML document, respond to actions in real time (versus at submission time), and modify the style of each control depending on the device they are displayed on (desktop browser versus mobile versus text only, etc.). There is often no need for any scripting with languages such as JavaScript. However, XForms does include an event model and actions for implementing more complex form behaviors.<ref>{{Cite journal|title=Live XML Data|first=Steven|last=Pemberton|date=June 2014|journal=XML London 2014|doi=10.14337/XMLLondon14.Pemberton01|pages=96–102|isbn=978-0-9926471-1-7|doi-access=free}}</ref> Actions and event handling are specified using the XForms XML dialect rather than more common scripting languages like JavaScript. Like web forms, XForms can use various non-XML submission protocols ([[multipart/form-data]], [[application/x-www-form-urlencoded]]), but a new feature is that XForms can send data to a server in XML format. XML documents can also be used to prefill data in the form. Because XML is a standard, many tools exist that can parse and modify data upon submission. Similar tools for legacy forms also exist. XForms is itself an XML dialect, and therefore can create and be created from other XML documents using [[XSL Transformations|XSLT]]. Using transformations, XForms can be automatically created from [[XML schema]]s, and XForms can be converted to XHTML forms.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)