JavaScript
  Home arrow JavaScript arrow Page 2 - Constructing a Multi-Column Online Form wi...
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
JAVASCRIPT

Constructing a Multi-Column Online Form with the Ext JS Framework
By: Alejandro Gervasio
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 3 stars3 stars3 stars3 stars3 stars / 2
    2009-02-10

    Table of Contents:
  • Constructing a Multi-Column Online Form with the Ext JS Framework
  • Review: building a field-set grouped web form using the Ext JS library
  • Building a multi-column web form
  • Listing the application’s full source code

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Constructing a Multi-Column Online Form with the Ext JS Framework - Review: building a field-set grouped web form using the Ext JS library


    (Page 2 of 4 )

    In the introduction, I explained the approach that I used in the previous tutorial to construct a sample online form whose respective input boxes were distributed in two separated field sets. I think it would be helpful to show the complete source code corresponding to this specific example, so you can recall more easily how it worked.

    Having said that, here’s the definition of the (X)HTML file that renders this web form:


    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

    <html>

    <head>

    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

    <title>Simple Form with FieldSets</title>

    <link rel="stylesheet" type="text/css" href="ext-all.css"/>

    <link rel="stylesheet" type="text/css" href="forms.css"/>

    <!-- common styles for the examples -->

    <link rel="stylesheet" type="text/css" href="examples.css"/>

    <script type="text/javascript" src="ext-base.js"></script>

    <script type="text/javascript" src="ext-all.js"></script>

    <script type="text/javascript">

    Ext.onReady(function(){

    var fieldsetForm=new Ext.FormPanel({

    labelWidth: 75,

    url:'processform.php',

    frame:true,

    title: 'Simple Form with FieldSets',

    bodyStyle:'padding:10px 10px 0',

    width: 350,

    items: [{

    xtype:'fieldset',

    checkboxToggle:true,

    title: 'User Data',

    autoHeight:true,

    defaults: {width: 210},

    defaultType: 'textfield',

    collapsed: true,

    items :[{

    fieldLabel: 'First Name',

    name: 'first',

    allowBlank:false

    },{

    fieldLabel: 'Last Name',

    name: 'last'

    },{

    fieldLabel: 'Company',

    name: 'company'

    }, {

    fieldLabel: 'Email',

    name: 'email',

    vtype:'email'

    }

    ]

    },{

    xtype:'fieldset',

    title: 'Phone Number',

    collapsible: true,

    autoHeight:true,

    defaults: {width: 210},

    defaultType: 'textfield',

    items :[{

    fieldLabel: 'Home',

    name: 'home',

    value: '(777) 555-1010'

    },{

    fieldLabel: 'Business',

    name: 'business'

    },{

    fieldLabel: 'Fax',

    name: 'fax'

    }

    ]

    }],

    buttons: [{

    text: 'Save'

    },{

    text: 'Cancel'

    }]

    });

    // display dynamic web form

    fieldsetForm.render(document.body);

    });

    </script>

    </head>

    <body>

    <h1>Simple Form with two Field Sets</h1>

    </body>

    </html>


    Now that you have had the chance to take a look at the above example, hopefully you’ll recall how simple it is to build a field set-grouped web form by utilizing the Ext JS library. Essentially, the entire creation process is reduced to spawning an instance of the its “FormPanel” class, and then feeding the class in question the appropriate incoming arguments to customize the visual appearance of the form. That’s all.

    And speaking of visual appearance, below I included a simple screen capture, which certainly will give you a better idea of how this dynamic online form looks. Here it is:

    Okay, at this point you hopefully recalled the complete details concerning the construction of a sample web form that’s composed of two field sets. Therefore, the next topic that I’m going to discuss will consist of demonstrating how to use the Ext JS package for creating a multi-column online form.

    This form will include a neat HTML editor. To learn how it will be built, please click on the link that appears below and read the next section. I’ll be there, waiting for you.

    More JavaScript Articles
    More By Alejandro Gervasio


       · The Ext JS library permits to build, among other useful interfacing components,...
     

    JAVASCRIPT ARTICLES

    - Comparing Fields and Customizing Error Messa...
    - Checking Numbers and File Extensions with jQ...
    - Validating Digits and Dates with jQuery`s Va...
    - Validating Ranges, Emails, and URLs with jQu...
    - More Uses for the jQuery Tooltip Plug-in`s b...
    - Building Image-Based Tooltips with the jQuer...
    - Using the jQuery Tooltip Plug-in`s bodyHandl...
    - Using Rangelength, Min and Max with the Vali...
    - Using Minlength and Maxlength with the Valid...
    - Modifying Tooltip Coordinates with the jQuer...
    - Applying a Fade Out Effect with the jQuery T...
    - Tracking Mouse Movements with the jQuery Too...
    - Checking Online Forms with the Validator jQu...
    - Nested JavaScript Functions as Objects
    - The jQuery Tooltip Plug-in







    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 6 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek