NetCloak Demo


  The Pro version of NetCloak includes a powerful array of capabilities for handling data from HTML forms. Now users can communicate back to you! Your site will become interactive as well as dynamic when you use NetCloak Pro to allow users to add new content or information to your site, without knowing anything about HTML. NetCloak Pro gives you complete control over this, of course, so that users can only do what you allow them to do.

NetCloak Pro can take data submitted from an HTML form and collect it in a data file, send it as preformatted e-mail messages, or even add new HTML pages to your site. You can implement on-line surveys, feedback forms or even threaded discussion forums that users can access with just their web browser.

Understanding Forms Processing with NetCloak Pro

Forms processing with NetCloak Pro is controlled by special template files you create using NetCloak's forms processing commands. These files tell NetCloak what to do with the data from the HTML form- save it to a text file, create a new HTML page or send an e-mail message (or several of these things). Similar to a mail merge file in a word processor, the template also defines what the created text file, web page or e-mail message will look like.

NetCloak's forms processing commands are collectively referred to as Forms Definition Markup Language, or FDML for short. The template files you create with them are then called FDML Files or FDML Templates. Processing form information in flexible ways is not a trivial matter, but don't think FDML is complicated just because it has a fancy acronym name. Like the other aspects of NetCloak, taking forms processing one step at a time makes the task simple.

The diagram below shows an overview of how forms processing works. First, the user enters data into an HTML form. When the user clicks the submit button, their web browser sends the data from the form to the server. With the data the browser also sends the action specified in the HTML form, which tells the server to use a NetCloak Pro FDML template to process the data.

Overview of forms processing with FDML Templates

The server passes the data and the name of the template to NetCloak, which then reads the template. First in the template is a directive that tells NetCloak what to do- in this case, CREATEDOC tells it to create a new HTML document. The rest of the template determines what the contents of the new HTML page will look like, and NetCloak inserts data from the form in place of the REPLACE commands. At the bottom of the diagram is the new HTML page that NetCloak has created.

Creating HTML Input Forms

The first step in building all forms processing systems isn't the FDML file, but rather the HTML input form itself. All modern HTML editors will allow you to build HTML forms, and they can also be created using any text editor without much difficulty. Building HTML forms is outside the scope of this tutorial, and how this is done will vary depending on your HTML editor. See the User's Guide that came with your HTML editor, or one of the excellent on-line HTML tutorials for complete details on creating input forms in HTML. The NetCloak user's guide also has a brief reference list of HTML form fields if you need to brush up.

There is one aspect of the form that is dictated by NetCloak, the FORM ACTION. Every HTML form includes a FORM tag, and one of the parameters of this tag, the ACTION parameter, tells the browser where to send the information once the user fills in the form and clicks the submit button. When you create the form, be sure to specify the ACTION as the URL to the FDML template. The URL is no different from any other link, it can be a full URL, root relative, or partial, just like any hypertext link.

The FORM tag will look like one of these, depending on the URL you specify:

    <FORM METHOD=post ACTION="Feedback.FDML">
    <FORM METHOD=post ACTION="/Development/Test.FDML">
    <FORM METHOD=post ACTION="http://my.server.com/Support/Mail.FDML">

Form Processing Directives

The most important part of the FDML file is the directive which will tell NetCloak how to process the form data. There are 4 different basic actions NetCloak can perform when a form is submitted, each of which is invoked using a different Primary Directive at the beginning of the FDML file:

  1. TEXTSTORE: Stores the user input in a tab-delimited text file, suitable for importing later into a database, spreadsheet, custom application, text editor, etc.

  2. SENDMAIL: Sends a formatted e-mail message to any standard e-mail account.

  3. CREATEDOC: Creates a new text file on your Web server. The files created by NetCloak are usually, but not necessarily, new HTML files that can then be accessed by a Web browser.

  4. INSERTFILE: Inserts new text or HTML into an existing file on the server.

The tutorial examples following this one describe how to use the most common directives, SENDMAIL, INSERTFILE and CREATEDOC. One of the simpler and most popular of these actions is SENDMAIL, so we will start there. The simplest, TEXTSTORE, is straightfoward enough that you should be able to understand it with the simple explanation in the User's Guide.

Before jumping right into how to make your own FDML template files, there are a few general points about FDMLs. To start, remember that FDML files are not HTML files, so the WYSIWYG HTML editor you are used to using is not a good choice for creating FDMLs. Some FDML files will create HTML or HTML documents, so an HTML editor can be useful for creating the design of the resulting pages. Once you have roughed out the format with an HTML editor you will want to use a text editor like BBEdit to finish up. Using an FDML file to send an e-mail message, though, really has nothing to do with HTML so you should start and end with your text editor.


So why can't I use HTML Source mode in my HTML editor? This may appear to work if you try it. When many WYSIWYG HTML editors output the final site, though, they will attempt to check and fix the HTML syntax. Since the NetCloak forms processing commands look like HTML, these applications frequently assume that they are malformed HTML tags and try to "fix" them. This "fix" will generally ruin your FDML template.

There is hope, though. Dreamweaver can be extended with objects for third-party add-on tags like NetCloak commands. A set of Dreamweaver objects for NetCloak is included in the package, and with them, you will be able to create pages with NetCloak's dynamic page and forms processing commands right in Dreamweaver. Similar extensions may be available for other editors soon.



[ Move On To The Next Tutorial | Return To The NetCloak Introduction ]