Form Documents
A wax:form collects many wax:block s and
wax:formblock s for gathering user input. This tag
indicates that all of the data gathered by it's children are
to be sent or submitted to one URI.
The example below asks the user to enter a dinner time. The data
is saved in a variable dinner and when submitted is
sent to /some/place .
<wax:wax xmlns:wax="http://www.morphis.org/wax" version="1.0">
<wax:doc>
<wax:form href="/some/place" method="get"
submittext="Submit">
<wax:formblock>
<wax:p>Enter dinner time:</wax:p>
<wax:entry var="dinner"/>
</wax:formblock>
</wax:form>
</wax:doc>
</wax:wax>
|
The form submission model is close to that of HTML, many form
components live under one form tag which tells the client
where to send the data entered. However to
get this model to translate to other languages like WML and HDML
some things need to happen during the translation to get the correct
behavior.
When the wax:form has a submittext
attribute this signals that a special hidden WML or HDML card
needs to be created to submit the data gathered.
This card gathers all the variables specified within
the wax:form body, these maybe from
wax:choice , wax:entry , or
wax:setvar tags, and sends them to the URL given by
the href attribute. A small navigation note: if you
want to jump directly to this "submit" card you can specify the
href as "#submit "
This submit card is inserted in the translation after
the last wax:formblock or wax:block .
In the translation a button will be added to the last block to point
to the submit card with a label specified by the
attribute submittext .
If the wax:form does not specify the attribute
submittext then the translation will not insert the
submit card and the application developer needs to
handle any data submission explicitly.
|