Event Registration (Behind the Scenes)

[ << Back to Example ]

Overview

The Event Registration example demonstrates a fill out form used to accept registrations for a conference. Users are prompted to provide personal information and registration preferences, as well as (optionally) more detailed demographic data. The data entered by the user is appended to the Registrations table of the examples database.

This example demonstrates the use of data validation rules to require entry in key fields (name, e-mail, etc.) as well as constrain the values (by data type and range) allowed in other fields.


Implementation Files

Directory Name: EVENTREG
File Name       Type       Function                         

MAIN.HTM        HTML       Allows the user to register for  
                           the event.                       

THANKS.DBM      Template   Inserts the registration and then 
                           thanks the user for submitting 
                           the registration.                           

MAIN.HTM

<HTML>

<HEAD>
<TITLE>Event Registration Example</TITLE>
</HEAD>

<BODY>

<H1>Event Registration Example</H1>
<a href="details.htm"><img src="../how.gif" border=0 align=middle></a> 
<a href="details.htm">Behind the Scenes</a>
<HR>
<P>
<H3>WebDev '95 Registration Form</H3>

<FORM ACTION="/~wsapi/cfusion?Template=/cfstand/examples/eventreg/thanks.dbm" 
      METHOD="POST">

  <!-- Hidden fields for entering additional information about the submission -->
  
  <INPUT TYPE="hidden" NAME="DateRegistered" VALUE="CurrentDateTime()">
  <INPUT TYPE="hidden" NAME="ClientAddress" VALUE="CGI.REMOTE_ADDR"> 
  <INPUT TYPE="hidden" NAME="ClientBrowser" VALUE="CGI.HTTP_USER_AGENT">


  <!-- Data validation rules -->

  <INPUT TYPE="hidden" NAME="FirstName_required" 
      VALUE="You must enter a first name.">
  <INPUT TYPE="hidden" NAME="LastName_required" 
      VALUE="You must enter a last name.">
  <INPUT TYPE="hidden" NAME="EMail_required" 
      VALUE="You must enter an e-mail address.">
  <INPUT TYPE="hidden" NAME="MainTrack_required" 
      VALUE="You must select a conference track to attend.">
  <INPUT TYPE="hidden" NAME="Employees_integer">
  <INPUT TYPE="hidden" NAME="CGIDatabase_range" VALUE="MIN=1 MAX=10">
  <INPUT TYPE="hidden" NAME="FullTextIndexing_range" VALUE="MIN=1 MAX=10">
  <INPUT TYPE="hidden" NAME="AdobeAcrobat_range" VALUE="MIN=1 MAX=10">
  <INPUT TYPE="hidden" NAME="MMDirector_range" VALUE="MIN=1 MAX=10">
  <INPUT TYPE="hidden" NAME="HotJavaApplets_range" VALUE="MIN=1 MAX=10">
  <INPUT TYPE="hidden" NAME="VRMLModels_range" VALUE="MIN=1 MAX=10">


  <!-- Data entry fields -->


<PRE>
<B>Personal Information:</B>

       Name:<INPUT NAME="FirstName" size=15> <INPUT NAME="LastName" size=23>
    Company:<INPUT NAME="Company" size=40>
     E-Mail:<INPUT NAME="EMail" size=40>
      Phone:<INPUT NAME="Phone" size=15> Fax:<INPUT NAME="Fax" size=15>

<HR><B>Registration Options:</B>

      Which conference track do you wish to attend?

        <INPUT TYPE="radio" NAME="MainTrack" 
          VALUE="GettingStarted" CHECKED> Getting started with the Web 
        <INPUT TYPE="radio" NAME="MainTrack" 
          VALUE="EffectiveServices"> Designing effective on-line services
        <INPUT TYPE="radio" NAME="MainTrack" 
          VALUE="EmergingTech"> Emerging technologies and standards
        <INPUT TYPE="radio" NAME="MainTrack" 
          VALUE="DatabaseDev"> Web database development
        <INPUT TYPE="radio" NAME="MainTrack" 
          VALUE="Multimedia"> Web interactive multimedia development

      <INPUT TYPE="checkbox" NAME="TravelInfo" 
         VALUE="Yes"> Send me more information about conference 
          travel discounts.
      
      <INPUT TYPE="checkbox" NAME="HotelInfo" 
         VALUE="Yes"> Send me more information about conference 
          hotel accommodations

<HR><B>Company Information (Optional):</B>

      Company Type:
      <SELECT NAME="CompanyType" SIZE=4>
         <OPTION>Internet Service Provider
         <OPTION>Web Consulting/Development
         <OPTION>Web Server or Tool Vendor
         <OPTION>Other (Doing In-House Web Development)
      </SELECT>

      How many employees does your company have? <INPUT NAME="Employees" SIZE=8>

      On a scale of 1 to 10, how likely are you to incorporate 
      the following technologies into your Web development 
      projects during the next year:

        1 = Will not use the technology 
        5 = Will seriously consider using the technology
       10 = Will definitely use the technology

        <INPUT NAME="CGIDatabase" SIZE="5"> CGI-based database access
        <INPUT NAME="FullTextIndexing" SIZE="5"> Full-text document indexing
        <INPUT NAME="AdobeAcrobat" SIZE="5"> Adobe Acrobat document publishing
        <INPUT NAME="MMDirector" SIZE="5"> Macromedia Director titles
        <INPUT NAME="HotJavaApplets" SIZE="5"> Hot Java Applets
        <INPUT NAME="VRMLModels" SIZE="5"> VRML Models and Simulations

<HR>
      <INPUT Type="submit" Value="  Submit Registration  ">  <INPUT Type="reset" Value="Clear Entries">
</PRE>


<P>




<P>
<HR>
[ <a href="../examples.htm">Example Applications</a> ]
[ <a href="../../getstart.htm">Getting Started with Cold Fusion</a> ]

</BODY>
</HTML>


THANKS.DBM

<!--- Insert the data passed from the form --->

<DBINSERT DATASOURCE="CF Examples" TABLENAME="Registrations">

<!--- Display a message to the user indicating that the 
      registration was received --->

<HTML>

<HEAD>
<TITLE>Conference Registration Received</TITLE>
</HEAD>

<BODY>
<H1>Conference Registration Received</H1>
<HR>

<P>Thanks for registering to attend WebDev '95. We will send you 
additional information about the conference soon.

<P>
<HR>
[ <a href="/cfstand/examples/eventreg/main.htm">Event Registration Example</a> ]
[ <a href="/cfstand/examples/examples.htm">Example Applications</a> ]


</BODY>

</HTML>


[ Event Registration Example ] [ Example Applications ]