• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL

Chapter 15. Web Publishing > Prompting User Input with CDML

Prompting User Input with CDML

The database we used to set up the format file header above (webguest.fp5) contains name and address information, plus fields for email and Web addresses on a layout named Webform. We want this format file to prompt users to fill in their contact information, so we need to input the code in the format file for this action.

To prompt a user for input:

Open the template format file you created above. Change the Web page title and save it as a new file.

Position your cursor just before the </FORM> tag (Figure 15.34) and type the HTML code for the form's instruction text:

<P>Please enter your information to be included in our mailing list.</P><P></P>


Figure 15.34. Anything that will be a part of the form must appear before the </FORM> close tag.

Enter the following code to create the form's data entry fields. Since this is a Web page, all SIZE information is input in pixels. You can change these dimensions if you want.

<P>First Name: <INPUT TYPE="text" NAME="FirstName" SIZE=20></P> 
<P>MI: <INPUT TYPE="text" NAME="MI" SIZE=5></P>
<P>Last Name: <INPUT TYPE="text" NAME="LastName" SIZE=20></P>
<P>Address: <INPUT TYPE="text" NAME="Address" SIZE=20></P>
<P>City: <INPUT TYPE="text" NAME="City" SIZE=20></P>
<P>State: <INPUT TYPE="text" NAME="State" SIZE=5></P>
<P>Zip: <INPUT TYPE="text" NAME="Zip" SIZE=20></P>
<P>Phone: <INPUT TYPE="text" NAME="Phone" SIZE=20></P>
<P>Email: <INPUT TYPE="text" NAME="EmailAddress" SIZE=20></P>
<P>Web: <INPUT TYPE="text" NAME="WebAddress" SIZE=20></P>

Now we'll create the CDML code to add the data entered by the user into the FileMaker database.

<P><INPUT TYPE="submit" NAME="-new" VALUE="submit"></P>

The Submit command combined with the –new tag tells FileMaker to create a new record from the information that the visitor inputs. It also adds a Submit button to the form.

Save this page in your Web folder (Figure 15.35). In this example we've named it webguest.htm.

Figure 15.35. After entering the code for a format file, save it in the Web folder.



Not a subscriber?

Start A Free Trial

  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint