MS FrontPage

Creating a Confirmation Page

Imagine that you're visiting your own site and you complete one of your forms. After you click the Submit button, how can you be sure that your data actually went where it was supposed to go?

Don't leave your visitors hanging in doubt. Create a page that says "Yes, the button worked, the server received your input, and someone on the World Wide Web actually cares about you." Or just a simple "Thank you for your submission." Whatever you decide to write, the screen that appears following the click of a Submit button is called the confirmation page.

FrontPage's Automated Confirmation Page

The confirmation page is so important that even if you don't actively set one up, FrontPage automatically creates one for you. This is a simple, unadorned page, which thanks the visitor and shows them the data they entered (see Figure 15-11).

Figure 15-11. The confirmation page that FrontPage automatically generates is spare and unattractive. Also, fields don't appear in the same order they did on your form, which may confuse some viewers. You and your visitors will be happier if you create your own custom confirmation page.

Creating a Custom Confirmation Page

If you want, you can create you own confirmation pageone that matches your site's visual style and includes your own heartwarming message. To do so:

  1. Create an HTML page as you would any other.

    Add text to the page thanking the visitor, extolling their excellent data entry skills, or whatever you want to say.

    FrontPage includes a confirmation form within its Page Templates dialog box, but it's even less exciting than the completely automated one, and its field names will require some tweaking to match your form. You're better off starting from scratch.
  2. Insert confirmation fields.

    If you want to display the values a visitor entered on the confirmation page, you can do so by inserting confirmation fields that draw visitors' entries from the form onto the confirmation page for them to review. To do so, place your cursor where you want the data to appear. Then select Insert » Web Component » Advanced Controls and select Confirmation field from the list of options on the right. Then type in the name of the field whose results you want to display (this text must match your field name exactly). The field name appears in brackets on your page. When a viewer sees the confirmation page, whatever value she entered in the field displays instead. You should create a label for all your fields, so these values make sense. Repeat this step for every field you plan to show.

    Custom Validation Page

    When a visitor fills out a form and submits it, the server sends a confirmation page. However, when a visitor makes a mistake filling out a form, the server almost never sends a validation page. That's because validation takes place before form data ever reaches the server. The browser's in charge of validation. When a viewer doesn't enter information correctly and tries to submit the form, the browser doesn't send it to the server. Instead, the browser displays a pop-up message telling the viewer about the entry mistake and how to fix it. The validation page appears only if a viewer's configured his browser not to run JavaScript (very rare) and the bad data gets all the way to the server.

    For those rare instances, you can create a custom validation page. You create this kind of page the same way you'd create a custom confirmation page. The one difference is, when you get to step 2 in the instructions above, don't type a field name into the Confirmation Field Properties box. Type "Validation-Error" instead (see illustration). When you click OK, FrontPage displays a message telling you that the name isn't valid. Don't be deterred! Click OK to get rid of the prompt and FrontPage adds the field to your page anyway. (If FrontPage doesn't add the field for some reason, just type in "ValidationError" without the hyphen and click OK. Then open the page in Code view, find the "Validation-Error" text, and then insert the hyphen.)

    Once you've created and saved your page, open your form, right-click it, and then select Form Properties. Then click Options to open the Saving Results dialog box. Within the Confirmation tab pictured back in Figure 15-12, use the "URL of validation failure page" field to link the form to your new validation error page. You'll only be able to test the page if you disable scripts within your browser. (For example, in IE, select Tools » Internet Options, select the Security tab, click Custom Level, and disable active scripting.)

  3. Attach your custom confirmation page to the form page.

    Open the page your form is on. Right-click within the form and select Form Properties. Click Options and select the Confirmation Page tab (see Figure 15-12). In the "URL of confirmation page" field, browse to or type the relative URL path (Understanding Hyperlinks) and the file name.

Figure 15-12. Enter a path to a custom confirmation page. If you don't create one, FrontPage will, although you probably won't care for the results. Same goes for the Validation Failure page. FrontPage automatically creates a validation error page, but most viewers never see it (as explained in the box "Custom Validation Page").