JavaScript
  Home arrow JavaScript arrow Page 3 - Building Message Windows with the Ext JS L...
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

Building Message Windows with the Ext JS Library
By: Alejandro Gervasio
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 6
    2009-08-10

    Table of Contents:
  • Building Message Windows with the Ext JS Library
  • Building a professional-looking confirm box
  • Building a prompt box
  • Creating a multi-line prompt box

  • 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


    Building Message Windows with the Ext JS Library - Building a prompt box


    (Page 3 of 4 )

    As I stated in the prior section, the Ext JS library comes with a respectable number of interactive windows, including the popular prompt boxes. Of course, building this type of window is actually a no-brainer process; it only requires a few lines of JavaScript code and some basic markup.

    The following hands-on example demonstrates how to display a simple prompt box in the browser by using a brand-new method, called “prompt()”:


    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

    <html xmlns="http://www.w3.org/1999/xhtml">

    <head>

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

    <title>Building a prompt box with Ext JavaScript library</title>

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

    <link rel="stylesheet" type="text/css" href="xtheme-default.css" />

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

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

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

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

    <script type="text/javascript">

    // display prompt box when sample button is clicked on

    Ext.onReady(function(){

    Ext.get('samplebutton').on('click',function(e){

    Ext.MessageBox.prompt('Email', 'Enter your email address:');

    });

    });

    </script>

    </head>

    <body>

    <h1>Building a prompt box with Ext JavaScript library</h1>

    <button id="samplebutton">Display Prompt Box</button>

    </body>

    </html>


    As you can see in the above example, a single-line prompt box will be displayed on screen via the aforementioned “prompt()” method, which comes with the Ext JS library. In this particular case, the method in question will show a trivial message, but this can be easily modified to use different prompting text.

    The practical example that you just learned would be rather incomplete if I didn’t show you how the previous prompt box looks, so here it is:



    So far, so good. Now that you've hopefully grasped how to build a prompt box with the Ext JS package, it’s time to continue exploring its remarkable capabilities. In the upcoming section, I’m going to show you how to build a multi-line prompt window.

    Click on the link that appears below and read the next few lines. I’ll be there, waiting for you.

    More JavaScript Articles
    More By Alejandro Gervasio


       · The Ext JS library makes easy create different types of message boxes. This first...
       · Thanks for the article. I looked to the extJs before just for learning purpose...
       · Thanks for the kind words on my article, I really appreciate them. Just feel free to...
       · while reading your article last day, i decided to use ExtJs for a pop up message...
       · I think you need to use the "getAttribute()" method to parse DOM elements. Check the...
     

    JAVASCRIPT ARTICLES

    - Using jQuery to Preload Images with CSS and ...
    - Using Client-Side Scripting to Preload Image...
    - Removing Non-Semantic Markup when Preloading...
    - Using the Display CSS Property to Preload Im...
    - Preloading Images with CSS and JavaScript
    - Scaling and Moving Web Page Elements with th...
    - Fading, Hiding and Sliding HTML Elements wit...
    - Toggling CSS Properties with the GX JavaScri...
    - Cancel, Queue and Pause Animations with the ...
    - Producing Elastic Effects with the GX JavaSc...
    - Moving Divs Diagonally with the GX JavaScrip...
    - Moving Elements Vertically and Horizontally ...
    - Making Bouncing Effects in Parallel with the...
    - Creating Bouncing Effects with the GX JavaSc...
    - Manipulating Background Colors with the GX J...







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