Mail page: a form submission

Many applications involve some sort of form submission. The mail page in this sample application submits a form. The page displays messages and allows the user to reply by tapping a Reply link. The Reply link displays the form. For a full listing of the DHTML source code for this page, see Mail page sample: a form submission.

The mail page, as it displays initially, is shown in the following figure.

Mail page as initially displayed

This sample page displays short messages with a Reply link for the user to use to send a reply. When the user taps the Reply link, a scrolling text box appears for the user to enter the text of a reply. The figure below shows the mail page after the user has tapped the Reply link and entered text for a reply message.

The user taps the Send button when the reply text is complete, and the page submits the form to the server, which handles forwarding the message to the recipient.

Mail page after user has entered a reply

The DHTML code for the mail page uses the same approach as the Home page: expanding and collapsing hierarchical text and the Calendar page: hiding and displaying page elements to hide and display the form containing the scrolling text box.

The Send button submits the form to the server, which would handle the message from there.