Throughout this book, I've noted where pages contain features requiring that the FrontPage Server Extensions be on your remote server's site. The pages I referred to were mostly forms that incorporated one of FrontPage's runtime bots.
For the beginner, adding advanced features to Web pages can be a daunting task. FrontPage puts advanced features well within the capability of beginning page developers with the use of its advanced bots. These bots work with the server at runtime to process information; they allow a user to submit requests or information to your site that you can use many different ways.
What are these runtime bots, and why are they so special? Well, if it weren't for these bots, you'd need to write custom scripts to instruct your server how to handle the forms you create. This isn't an easy task for a beginner, which is one reason there are as many books on scripting languages as there are on HTML programming. Scout the shelves in your local bookstore sometime, and you'll see rows of books on CGI, Perl, Java, JavaScript, VBScript, and countless other languages that can be used with your Web pages. With these scripting languages, you can add functionality to your Web pages-if you want to get into programming, that is.
For those who don't want to learn all those other programming techniques, you have the FrontPage bots to fall back on, which are really nothing more than custom CGI scripts designed to work with the FrontPage Server Extensions-like the plug-and-play of Web pages.
Five bots work with forms: the WebBot Discussion Component, the WebBot Registration Component, the WebBot Save Results Component, the WebBot Search Component, and the Confirmation Field bot. You may choose any but the WebBot Search Component and the Confirmation Field bot when you configure a form handler for your form. The WebBot Search Component and Confirmation Field bot are inserted with the Insert | WebBot Component command but do work with form fields, as you will learn later in this chapter.
You might ask "Why do these bots need the Server Extensions, but the ones discussed in Chapter 14 don't?"
The bots you learned about in Chapter 14, "Automating Pages with Bots," don't require the FrontPage Server Extensions because they don't need user input to function. You control the content of those bots at design time, and their content is placed onto your pages in conventional form once your pages go out on the Web.
The runtime bots discussed in this chapter are basically CGI scripts written to be compatible with FrontPage and the Windows 95 or Windows NT operating system. They work seamlessly with FrontPage's Personal Web Server and the Microsoft Personal Web Server, which is why you can test the forms with your favorite browser while these Personal Web Servers are running.
More often than not, when your Web pages are placed "out there," they reside on a server that runs on a UNIX or Windows NT operating system. The runtime bots process the user's entries when he or she clicks the Submit button on your form. An executable file in your FrontPage-enabled Web site translates the data from your FrontPage form into language the UNIX or Windows NT server expects to see. That executable file is part of the FrontPage Server Extensions that need to reside on your remote server. In this case, the server extensions act as the go-between from the FrontPage bots to your server's operating system.
If your service provider doesn't have the FrontPage Server Extensions installed, you do have other options for adding interactivity to your Web site.
To use these alternative options, you need to understand how to work with other scripting languages. Unfortunately, it gets rather involved to discuss the different options and types of forms you can configure with scripts on a case-by-case basis. That subject goes far beyond the scope of this book, because so many variables come into play, such as using platform or browser-specific scripts, assigning directory permissions, and other advanced topics requiring some knowledge of the scripting language or languages you want to use.
Here are some options you can use to add forms to your pages:
With the basic information out of the way, the following sections will explain what each of the bots does and how you can use and configure them.
In Chapter 19, "Can We Talk?," you learned how to add discussion groups to your Web site by using templates and wizards, but you can also create your own discussion groups with the WebBot Discussion Component. This bot enables you to create an online discussion on your Web site. It collects information from a form, formats the results into an HTML page, and adds the new page to a table of contents and to a text index. It also gathers information from the form and stores it in one of several formats.
In Chapter 19, you also learned that it was possible to create a protected discussion in which you could register an end user for participation in a closed section of your Web site. The registration form that is placed in your root web uses a WebBot Registration Component. This bot does not allow access to a web unless users enter their names and passwords. A WebBot Registration Component adds the user name and password to the server's authentication database and then gathers information from the form and stores it in one of several formats, as discussed in "Configuring a Results File," later in this chapter.
The WebBot Save Results Component is the general-purpose form handler in FrontPage. It is used for many types of forms. Survey forms, guest books, information forms, and online ordering forms are some examples of what you can do with a WebBot Save Results Component. It gathers information from a form and stores it in a variety of Web page and text formats.
The WebBot search component creates a list of links to pages containing one or more words-that is, the search term-entered by the user in the form. The results returned to the user list pages in which his or her search term appears. The list can also include the file's date and size and the score for the quality of the search term's match.
When a user submits a response to a form on your page, you use a confirmation page to acknowledge his or her post. For this type of page, you use the Insert | WebBot command to place a Confirmation Field bot on your page for each name/value pair you want to acknowledge. The Confirmation Field bot retrieves the information the user entered into your form and places his or her response on the confirmation page.
To use any of the bots mentioned in this chapter, you first develop a Web page containing form fields appropriate for the type of bot you're assigning. After you design the form, assign one of the bots as a form handler by following these steps:
You can add a WebBot Discussion Component to a page that you create yourself. You need at least the following pages to completely configure a WebBot Discussion Component:
The easiest way to add a discussion group to your Web site is to use the Discussion Wizard, discussed in Chapter 19. This wizard streamlines the process of creating a discussion group, because the required forms and pages are automatically created and linked for you. You can then use the procedures outlined in the following numbered steps to configure or revise the WebBot Discussion Component on the discussion submission form. An example of a submission form is shown in Figure 22.2.
To add and configure a WebBot Discussion Component, follow these steps:
Use the Discussion tab of the Settings for Discussion Form Handler dialog box, shown in Figure 22.3, to configure the discussion and its table of contents arrangement. The steps to configure the WebBot Discussion Component follow:
Figure 22.3 : Use the Discussion tab to configure your discussion articles.
NOTE |
To view the discussion group articles in the FrontPage Explorer, choose Tools | Web Settings, click the Advanced tab, and check Show Documents in Hidden Directories. |
You use the Article tab, shown in Figure 22.4, to configure the articles in the discussion.
Figure 22.4 : Use the Article tab to assign a header and footer to your discussion articles.
To configure your articles, follow these steps:
Use the Confirm tab of the Settings for Discussion Form Handler dialog box, shown in Figure 22.5, to configure the confirmation page and validation page for the WebBot Discussion Component. The steps follow.
You use the WebBot Registration Component when you design a form that registers a user for an event or to gain entry to a protected Web page on your site. In Chapter 19 you learned that you can create a discussion group in which only registered users can participate. When you select this option, the Discussion Web Wizard generates a web self-registration form (shown in Figure 22.6), which is placed in your root web, as outlined in "Saving a Registration Page for a Protected Web," later in this chapter. This form uses a WebBot Registration Component. FrontPage gives you two templates to help you develop your own registration forms:
You can use either of the templates as guidelines to create your own registration form; follow these steps:
A results file is the page on your web that stores the data that was submitted by the user. This file can be a text file or an HTML file. Both the WebBot Registration Component and the WebBot Save Results Component (discussed in "Creating a General Form," later in this chapter) offer you a choice of configuring a results file. The Results tab, shown in Figure 22.8, is identical for both bots.
You configure a results file for a WebBot Registration Component or WebBot Save Results Component as follows:
Both bots offer several choices for how you store the results from forms on your Web site. To configure the settings for the results file, follow these steps:
NOTE |
When you collect information you will read from a Web browser or from FrontPage, you have the option to supply an .html or .htm extension. This causes the FrontPage Server Extensions to generate the HTML at runtime, which could make your Web site slower as more results are appended to the page. You can also save your results in formatted text format or periodically edit the results page and paste its contents into another Web page on your server. |
HTML. This is the default style. When you select this option, your results file is stored in an HTML page that uses normal text with line endings, as shown in Figure 22.9.
Figure 22.9 : A results file stored in HTML format.
HTML Definition List. When you select this option, your results file appears in a definition list. The names of the form fields appear as terms, and the values of the form fields appear as the definition. An example is shown in Figure 22.10.
Figure 22.10 : A results file stored in HTML definition list format.
HTML Bulleted List. When you choose this option, your results file appears in a bulleted list, as shown in Figure 22.11.
Figure 22.11 : A results file stored in HTML bulleted list format.
Formatted Text Within HTML. When you choose this option, your results file appears in formatted paragraphs with line endings, as shown in Figure 22.12.
Figure 22.12 : A results file stored in formatted text within HTML format.
Formatted Text. When you choose this option, the results file appears in formatted text, as shown in Figure 22.13.
Figure 22.13 : A results file stored in formatted text format.
Text Database Using Comma as a Separator. This option specifies a text file that uses commas to separate the values in the results file. An example is shown in Figure 22.14.
Figure 22.15 : A results file stored in the format text database using tab as a separator.
Text Database Using Tab as a Separator. This option specifies a text file that uses tabs to separate the values in a results file. Many database or spreadsheet applications allow you to import files of this type. An example is shown in Figure 22.15.
Figure 22.14 : A results file stored in the format text database using comma as a separator.
Text Database Using Space as a Separator. This option specifies a text file that uses spaces to separate the values in a results file, as shown in Figure 22.16. These files can be used with spreadsheet or database applications and are recommended for single-word responses to maintain proper formatting of the items in the database.
Figure 22.16 : A results file stored in the format text database using space as a separator.
Use the Confirm tab of the Settings for Registration Form Handler,
shown in Figure 22.17, or the Settings for Saving Results of Form
dialog box to configure the confirmation page and validation page
for the WebBot Registration Component or the WebBot Save Results
Component. The Confirm tabs are identical in each of these dialog
boxes. The steps follow:
Figure 22.17 : Use the Confirm tab to configure the confirmation page and validation page for your registration page.
NOTE |
The confirmation page notifies the user that his or her response was received by the web. If you don't specify a confirmation page, the WebBot component generates and maintains one automatically for you. The confirmation page thanks the user for submitting the form and returns the contents of the form by using Confirmation Field bots. You can enter one of three special attributes for a WebBot Registration Component confirmation page |
You can also choose to configure a second results file for the WebBot Registration Component or WebBot Save Results Component. You do this by using the Advanced Tab, shown in Figure 22.18, in the Settings for Saving Results of Form or Settings for Registration Form Handler dialog box.
To configure a second results file for a WebBot Registration Component or WebBot Save Results Component, choose one of the following:
The available choices for a second results file are the same as those described previously, in the section "Configuring a Results File."
Your form might have more fields than those available to choose from in the first tab of the Settings for Registration Form Handler or Settings for Saving Results of Form dialog box. By default, the results file returns all information on the form itself. You can use the Advanced tab to specify which additional fields the WebBot Registration Component or WebBot Save Results Component returns.
To configure additional fields for a WebBot Registration Component or WebBot Save Results Component, choose one of the following:
Figure 22.6 shows the registration form generated by the Discussion Web Wizard when you select to allow only registered users to participate in the discussion. As previously mentioned, this page must be located in the server's root web. The steps to complete this follow:
The WebBot Save Results Component is used as a form handler for general forms you place in your web, such as the Feedback Form template, the Guest Book template, and the Survey Form template, shown in Figure 22.19. You can use any of these examples as guidelines to develop your own forms.
Figure 22.19 : You can use the WebBot Save Results Component for forms of a general nature.
To create a general form, use one of the previously mentioned templates or design your own form with the Form Page Wizard; these methods help make the form layout a lot easier. After your form is designed, you can assign the WebBot Save Results Component as follows:
If your site is very large, including a search form in your Web site allows visitors to find topics of interest quickly and easily. There's really no hard and fast rule for where to put a search form in your web. The following list offers some ideas:
You can create a search form that searches your entire Web site, a portion of it, or only discussion articles. Figure 22.20 shows the search page that is generated by the Search Page template that you select from the New Page dialog box in the FrontPage Editor.
To create a search form, follow these steps:
When a user sends a response from a form to your site, it's nice to send them a thank you with a confirmation form. It lets users know that their information was received. The confirmation form can also include information about what you'll do with the information after you get it. For example, if you created a survey form, you can inform the user that once the survey is complete and tabulated, you'll post the results on your site. The confirmation page can be as simple as acknowledging that you received their information. Figure 22.22 shows the confirmation page that is generated when you choose Confirmation Form from the FrontPage Editor's New Page dialog box. The Confirmation Field bots are the items contained in brackets.
The Confirmation Field bot works somewhat the same as the Substitution bot (discussed in Chapter 14), except that it's directly tied to a WebBot Save Results Component or WebBot Discussion Component. The Confirmation Field bot works at runtime and requires processing from the server to insert its replacement text. It extracts information from the originating form and places the data on the confirming page.
To create a confirmation form, follow these steps:
One of the options you have if your Internet service provider
does not have the FrontPage Server Extensions installed is to
use a custom ISAPI, NSAPI, or CGI script to process your forms.
CGI (Common Gateway Interface) scripts are typically platform
dependent, and they reside on your service provider's server.
You need to coordinate usage of CGI scripts with them. ISAPI (Internet
Server Application Programming Interface) is an interface developed
by Process Software and Microsoft Corporation. NSAPI (Netscape
Server Application Programming Interface) is an interface developed
by Netscape Communications Corporation and runs only on Netscape
servers.
NOTE |
There are enough alternative options to make your head swirl. You can also use Java, JavaScript, ActiveX, and VBScript to process forms. See Chapter 23, "Java and Plug-Ins," and Chapter 24, "ActiveX and VBScript," to get a feel for what these other Web technologies can do for you. |
You might want to include advanced features in your form, such as automatically entering the results in a database or spreadsheet or tabulat ing totals in an online ordering form. In that case, some programming of your own is definitely in order. What's important to learn here is how to configure your FrontPage form to use that custom CGI script.
A form and script are usually developed in concert with each other. The script contains information on how to handle each of the form fields in the form, along with other instructions for the server. You can find several good examples of CGI scripts you can use, along with the HTML pages associated with them, at the following sites on the Web:
Matt's Script Archive has several good forms with features similar
to those some of the bots accomplish. You can find his site at
http://worldwidemart.com/scripts/.
Selena Sol's Public Domain CGI Script Archive also offers some creative examples of how you can use CGI scripts with forms, scripts, and Web page examples. The URL for this site is http://www.eff.org/~erict/Scripts/.
However, even if you use ready-made CGI scripts, you can still expect to spend some time on them. The CGI scripts must be tweaked in many cases to get them up and running on your own site. You might also need to check with your service provider to see whether you can use custom CGI scripts on your site-and if so, where you are allowed to place them. Sometimes, CGI scripts must be assigned a .cgi extension to be recognized on the server; other times, they have to be placed in a specific directory to function properly. These particulars should be coordinated with your ISP before you configure your form. At that time, ask your service provider how to assign permissions for the form. They may already have a "frequently asked questions" page on their site that deals with these issues.
If all this sounds confusing, don't feel bad. CGI scripts are not something you can learn to work with in a few minutes; if you find you're still scratching your head after a few days of working with them, you aren't the first. Several good resources on the Web for learning all about CGI scripts are listed in Appendix C, "Directory of Resources."
You assign an ISAPI, NSAPI, or CGI script to your FrontPage form in much the same way as you assign any of the other form-handling bots-with the Form Properties command. The steps follow:
You can assign extended attributes to any form field that uses a custom ISAPI, NSAPI, or CGI script as a form handler. To assign extended attributes to a form, follow these steps:
You learned in Chapter 16, "Database Connectivity," how to generate an Internet Database Connector (IDC) file that connects to an ODBC-compliant database. FrontPage allows you to configure your forms to work with this IDC file, as shown in Figure 22.25. The steps to complete this follow:
NOTE |
To use the Internet Database Connector as a form handler, your Web site must reside on a server that uses the Microsoft Internet Information Server (IIS), running under Windows NT 3.5.1 or above, or the Microsoft Personal Web Server, running under Windows NT. |
You can display forms in tables or frames much as you can any other type of content. To display a form in a table, create the form by using the Form Page Wizard, or build your own as you've learned in this section. You can copy the form into the clipboard and paste it into a table, or you can insert the form into another page with an Include bot.
You can also configure forms to direct their output to a frame. The steps are as follows:
You should now know all the basics about designing forms in FrontPage. If you want to learn more about writing your own scripts, refer to the online sources listed in Appendix C. Other options you can use as an alternative to CGI are discussed in Chapters 23, "Java and Plug-Ins," and 24, "ActiveX and VBScript."
In this chapter, you learned how to configure FrontPage's runtime bots-the backbone of form handling in FrontPage. You learned why you need the FrontPage Server Extensions to use the bots covered in this chapter and how they enable you to add interactivity to your site without programming. You learned about results files and how to store them to your site in several different formats. You also learned how to configure your FrontPage forms to use the IDC files generated by the Database Connector Wizard and how to assign custom ISAPI, NSAPI, and CGI scripts to your forms. You should now have an understanding of what really makes these forms tick.
If the features that are built in to FrontPage aren't enough for you, get ready for an introduction into some exciting Web technologies that can take you in just about any direction. If you want to add pizzazz to your site, read on. You'll learn how to add multimedia, native document viewing, and even more interactivity into your site, using Java, JavaScript, Netscape Plug-Ins, ActiveX, and VBScript. With these Web technologies, the sky is the limit.
For additional information on topics related to this chapter, refer to these chapters:
Q: | I designed my form, I've got everything configured, and my Internet service provider has the FrontPage Server Extensions installed. Is there anything else I need to know about forms? |
A: | Believe it or not, after three chapters, you've finally got it all. If you want to go beyond what you've learned, you can get even more interactivity if you write custom routines yourself. |
Q: | Where should I put the results files? |
A: | It's best to put them in a location where your table of contents can't find them. If your service provider has the FrontPage Server Extensions installed, the most likely place is the _private directory, because your Table of Contents bot doesn't look there. Browsers can't find that one, either. |
Q: | If I place more than one form on a single Web page, do their results go to the same file? |
A: | No, you can configure them to go to different files, just as you could if they were on separate pages. Of course, if you want all the forms on a single page to point to one results file, you can do that, too! |