NetForms User's Guide: A Tricky Example

This example is a "Feedback" system that allows users to enter comments about the Internet into your server. Other users can then add responses to the original comments. Before you start reading how the tricky example is put together, make sure you have entered a few articles and know how it works.

The "Feedback Home Page" is a standard HTML document with links to the original article entry form and to several separate menu documents. In this example, new articles will be broken down into one of several "forums" to make it easier for users to find what they are looking for. This particular example uses the forums "General Internet", "This Site", and "Other Sites", but it could be any other logical breakdown of topics. The recipe system, for example, could have had forums for "main courses", "desserts", etc.

Each of the forums has it's own menu document. These documents are all exactly the same, except for their titles and minor variations in their text. Most importantly, since each menu document will be updated by NetForms, each needs to have a single unordered list.

The entry form isn't complicated either. We use a pop-up list for the topic name instead of a text entry box to avoid typos and to make things easier for the user. The rest of the form is straightforward.

Now for the interesting part. The "Feedback.FDML" file is going to generate the original articles. Responses to original articles will be handled by a separate FDML document described later.


<CREATEDOC>"/Feedback/<REPLACE ForumName>Articles/<REPLACE_FN DocTitle>.html"</CREATEDOC>
<AUTOLINK>"/AutoLink.doc"</AUTOLINK>
<MENUDOC>"/Feedback/<REPLACE ForumName>Menu.html" <LI> <A HREF="<HTMLFILENAME>"><REPLACE DocTitle> (<DATE>)</A></MENUDOC>
<RESPONSE>"/Feedback/Response.html"</RESPONSE>
<RECENTLIST><LI> <A HREF="<HTMLFILENAME>"> <REPLACE DocTitle></A></RECENTLIST>
<HTML>
<HEAD>
<TITLE><REPLACE DocTitle></TITLE>
</HEAD>
<BODY>
<H1><REPLACE DocTitle></H1>
<Address>This article submitted by <REPLACE Author> on <DATE>.</Address>
<BR>
<REPLACE ArticleText>
<P>
<LINKNEXT><BR>
<LINKPREVIOUS><BR>
<A HREF="<MENUFILENAME>">Return to Topic Menu</A>
<HR>
<H3>Here is a list of responses that have been posted to this article...</H3>
<UL>
</UL>
<HR>
<H3>If you would like to post a response to this article, fill out this form completely...</h3>
<FORM method=POST action="/NetForms.acgi$/Feedback/FeedbackResponse.FDML">
Response Title: <INPUT TYPE="text" NAME="DocTitle" SIZE="32" MAXLENGTH="32"><BR>
Author: <INPUT TYPE="text" NAME="Author" SIZE="32" MAXLENGTH="32"><P>
Response Text:<BR>
<TEXTAREA name="ArticleText" rows=10 cols=60></textarea><P>
Original Article: <INPUT TYPE="text" NAME="OrigArticle" SIZE="20" MAXLENGTH="40" VALUE="<REPLACE DocTitle>"> (Don't change this field!)
<BR>
Forum: <INPUT TYPE="text" NAME="OrigForum" SIZE="16" MAXLENGTH="16" VALUE="<REPLACE ForumName>"> (Don't change this field either!)
<P>
<INPUT type=submit value="Submit Response"> <input type=reset value="Start Over"><p>
</FORM>
<HR>
Article complete.  Click <A HREF="/Feedback/Feedback.html">HERE</A>
to return to the Feedback Menu.
</BODY>
</HTML>
The "Feedback.FDML" file

The very first line, the <CREATEDOC> directive, places the new document into a subfolder based on the name of the forum. Placing documents into separate forum sub-folders is not necessary, but will help to keep the documents in each folder to a manageable number, in addition to providing a logical breakdown. (It will also help protect against duplicate file names... Without these subfolders, two articles in two different forums could not have the same name.)

Also, notice the MenuDoc directive. Using the Replace command here makes sure that the correct menu document will be updated.

But the real trick to this file is that HTML documents generated by this document will contain not only the content of the original message, but a menu of responses and an input form as well. Note the bullet list (<UL></UL>, since it's empty to begin with), which is preceded by a text blurb stating that responses are available. This bullet list will be updated automatically when responses are posted to the original article.

Finally, there is another entry form at the end of the document. It is very basic, except for the last two fields. When the form is displayed, these fields will default to the correct values, and must not be modified by the users. They are used to pass critical information to the response FDML process.

When a user fills in the response entry form, NetForms will again be invoked, but this time, it will use the "FeedbackResponse.FDML" file...


<CREATEDOC>"/Feedback/<REPLACE OrigForum>Articles/<REPLACE_FN DocTitle>.html"</CREATEDOC>
<AUTOLINK>"/AutoLink.doc"</AUTOLINK>
<MENUDOC>"/Feedback/<REPLACE OrigForum>Articles/<REPLACE_FN OrigArticle>.html" <LI> <A HREF="<HTMLFILENAME>"><REPLACE DocTitle> (<DATE>)</A></MENUDOC>
<RESPONSE>"/Feedback/Response.html"</RESPONSE>
<RECENTLIST><LI> <A HREF="<MENUFILENAME>"> <REPLACE OrigArticle></A></RECENTLIST>
<HTML>
<HEAD>
<TITLE><REPLACE DocTitle></TITLE>
</HEAD>
<BODY>
<H1><REPLACE DocTitle></H1>
<ADDRESS>This response submitted by <REPLACE Author> on <DATE>.</ADDRESS>
<BR>
<REPLACE ArticleText>
<P>
<LINKNEXT><BR>
<LINKPREVIOUS><BR>
<A HREF="<MENUFILENAME>">Return to Main Article</A>
<HR>
Article complete.  Click <A HREF="/Feedback/Feedback.html">HERE</A>
to return to the Feedback Menu.
</BODY>
</HTML>
The "FeedbackResponse.FDML" file

The only thing new and tricky here is that this document uses the original article document as its menu. By doing this, responses will be added directly in to the bullet list on the original article page.
NetForms (C) 1994 by Maxum Development Corp.

Return to the contents page