This site has been taken over by the staff of www.ASPDeveloper.Net

Please report errors to suggest@aspdeveloper.net

BizTalk Utilities CV ,   Jobs ,   Code library  
 
 
Page 4 of 7

 

Previous Page Table Of Contents Next Page

Understanding XForms, cont.

Using Forms Today

This chapter is a primer on XForms; however, it's important that you understand and are able to use current form applications. Table 8.1 lists all XHTML elements and attributes used to create forms. For detailed descriptions of these elements and attributes, see Chapter 3, "Overview of Element Structure."

Table 8.1  XHTML Form Elements and Attributes

Element Name  Empty Description   Possible Attributes
button No Creates an input button disabled, name, tabindex, type, value
fieldset No  Groups related form controls None
form No Contains form block accept, accept-charset, action, enctype, method
input Yes Defines type and appearance for input objects accept, align*, alt, checked, disabled, maxlength, name, readonly, size, src, tabindex, type, usemap, value
isindex Yes Solicits a single line of input from users prompt
label No Identifies form controls accesskey, for
legend No Provides a caption to a set of related form controls align*, accesskey_
option No Assigns a value to an input label disabled, selected, value
optgroup No Groups selection choices logically disabled, label
select No Creates a menu of scrolling list of input items disabled, multiple, name, size, tabindex
textarea No Multiple line text area accesskey, cols, disabled, name, readonly, rows, tabindex

*Denotes a deprecated attribute

Example 8.1  A Simple XHTML Form Enables Customer Data to Be Sent to a Server

<?xml version="1.0"?>

<!DOCTYPE html

     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"

     "DTD/xhtml1-transitional.dtd">

<html>

  <head>

    <title>Title of the document.

    </title>

  </head>

  <body>

    <form action="URL" method="post">

      <p>This is a simple form.

      </p>

      <fieldset>

        <legend>Customer Information</legend><br />

        Last Name: <input name="lastname" type="text" tabindex="1"

        /><br />

        First Name: <input name="firstname" type="text" tabindex="2"

        /><br />

        E-mail Address: <input name="address" type="text" tabindex="3"

        />

      </fieldset>

    </form>

  </body>

</html>

The input elements collect data-in text form-from the user. That data is then instructed by the form element to be passed to a Uniform Resource Locator (URL) to be processed. That URL points to a server application ready to process the data. It's as easy as that.

To see how this example renders in a browser, see Figure 8.3.

Figure 8.3  A simple form displayed in a browser.

(NOTE:  This image is only available in the book, not in this article)

Page 4 of 7

 

Previous Page Table Of Contents Next Page
 

Recent Jobs

Software Specialist, Linux - Finlan
Linux Core Technical Project Manage
Graphics designer at Tanzania. Expe
Integration Specialist Needed - Wor
Virtualization Server Infrastructur

View all Jobs (Add yours)
View all CV (Add yours)






    Email TopXML  

Front Page Daily Stuff TopXML Forum XML blogs XML Newsgroups BizTalk Biztalk Utilities Biztalk Utilities Tutorial B2B SAP XML Microsoft .NET Dotnet System XML Soapformatter SQLXML XMLserializer XQuery PHP PHP SimpleXML PHP XML Dom PHP XML RPC PHP XSLT Java Java Java XML Xalan Microsoft ASP ASP Schemas XML SQL Server XML XMLDom XSL XSL Tutorial XSLT Stylesheets General Javascript CSS XHTML WAP