Third-party packages present you with many options for building rich web-based user interfaces. They can be used to fit a broad range of requirements. You may even have used such packages as the Yahoo User Interface and the Scriptaculous DHTML framework. But there's a new library worth looking into. It's called Ext JS. We'll take a close look at how it can help us build user interfaces in this five-part series.
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">
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.