Wednesday, September 17, 2008

Dealing with XForms - PHP

» XForms defines a variation on traditional webforms which allows them to be used on a wider variety of platforms and browsers or even non-traditional media such as PDF documents.

The first key difference in XForms is how the form is sent to the client. » XForms for HTML Authors contains a detailed description of how to create XForms, for the purpose of this tutorial we'll only be looking at a simple example.
Example - A simple XForms search form
<h:html xmlns:h="http://www.w3.org/1999/xhtml"

       xmlns="http://www.w3.org/2002/xforms">

<h:head>

<h:title>Search</h:title>

<model>

 <submission action="http://example.com/search"

             method="post" id="s"/>

</model>

</h:head>

<h:body>

<h:p>

 <input ref="q"><label>Find</label></input>

 <submit submission="s"><label>Go</label></submit>

</h:p>

</h:body>

</h:html>

Read more >>



The above form displays a text input box (named q), and a submit button. When the submit button is clicked, the form will be sent to the page referred to by action.

No comments: