XHTML 2.0 Explained - XForms
(Page 5 of 6 )
XForms: The Future of Forms
XForms give you total control over client-side form entry and are very powerful. XForms are very complicated, and covering them completely is out of the scope of this article. However, the idea is that they use XML. Everything is in the <xforms:model> tag. The form defines generic tags which are specified by XHTML. Something like this will be done:
<xforms:model>
<xforms:instance>
<name />
<age />
<sex />
</xforms:instance>
<xforms:submission action = "post.php" method = "post" />
</xforms:model>
Then, in regular XHTML, you would go ahead and define them however you want.
<input ref = "name">
<label>Name: </label>
</input>
<input ref = "age">
<label>Age: </label>
</input>
<input ref = "sex">
<label>Sex: </label>
</input>
<submit submission = "submit">
<label>Send</label>
</submit>
There are more complicated things you can do, too, but that is all out of the scope of this article. If you are truly interested in using XForms, check out the specification:
http://www.w3.org/TR/xforms
We are just scratching the surface of what XHTML 2.0 can do. Since it's fully integrated with XML, you can define your own namespaces however you want. The power of XHTML 2.0 is enormous.
Next: The MIME Situation >>
More HTML Articles
More By Sasha Slutsker