You will need to have a location on the web to put your new page. You can keep it either on the computer hosting FileMaker and have FileMaker itself serve the page or you can put it onto another computer.
Fields in the form:
You can find documentation for forms at http://www.rochester.edu/Manual/Documentation/CGI.html.
To enable the form to use the web to interface with the FileMaker database, you will need a line that calls the FMPro CGI script from the computer that is hosting FileMaker and the database:
<form action="http://computerHostingFileMaker:8080/FMPro" method="POST">
You will also need a line to tell FileMaker the form that you are going to be accessing:
<input type="hidden" name="-db" value="formBeingUsed.fp3">
These next two lines tell FileMaker which page to use if the submission submits correctly or if there is an error. The file "add.html" will be on the computer hosting FileMaker. The error and successful pages will be in this same document and make use of the Claris Dynamic Markup Languague which FileMaker uses. FileMaker will dynamically create a page based on the CDML tags within add.html.
<input type="hidden" name="-format" value="add.html">
<input type="hidden" name="-error" value="add.html">
The final touch on the page is the submit button. The button must have the "-new" to tell FileMaker that it is adding a new entry to the database.
<INPUT TYPE="submit" NAME="-new" VALUE="Send
Information">
The rest of the form will use standard form elements. However, for the item to work, you must have a NAME="Field Name" in the HTML tags which consitute the form. Each tag should have a different field name, except for certain things like radio buttons. Here is an example textfield that will be the field "Last Name:"
<INPUT type="text" name="Last Name" size="40">
Required Fields:
To set up a required field for the form, you have to set it in FileMaker. You will need to open the File menu, then the Define menu, and then select Fields. In the resulting window, highlight the item you want to make required, click on Options, and click the Validation tab in the new window. Check the box that says "Not empty," click "Ok," and then "Done." In the next section, you will see how to show a response telling the user that he/she didn't fill in fields.
Response pages
The response page, add.html will look like this:
<HTML> |
The page above will redirect the user to the correct response page on a different server (in this case www.rochester.edu).
This page illustrates use of CDML (the things in [square brackets] to tell FileMaker what to do when serving the page.* CDML is a type of simple programming language useful for changing the way a page looks depending on different parameters. For example, the [FMP-IF] statements will tell FileMaker to do something IF something else was true. In this case, FileMaker will serve up a different page that will redirect to either a "Page Added," "Fields Missing," or "Error" page depending on any errors FileMaker records when adding the new entry.
* CDML only works when being served by FileMaker