home *** CD-ROM | disk | FTP | other *** search
/ Computer Shopper 139 / dpcs0999.iso / Web / CFserver / data1.cab / Examples / employee / InsertForm.cfm < prev    next >
Encoding:
Text File  |  1999-04-12  |  1.8 KB  |  73 lines

  1. <!--- This template allows the user to provide information about
  2.     a new employee, and passes the data to InsertAction.cfm, which
  3.     adds the data to the database --->
  4.  
  5. <CFINCLUDE TEMPLATE="_header.cfm">
  6.  
  7. <!--- This fetches the names and ID's of the departments, which will
  8.     allow us to create a drop-down box --->
  9. <CFQUERY DATASOURCE="CFexamples" NAME="GetDepartments">
  10. SELECT * FROM EmpDepartments
  11. ORDER BY DepartmentName
  12. </CFQUERY>
  13.  
  14. <TR>
  15.        <TD WIDTH=100 ALIGN="RIGHT" VALIGN="TOP" HEIGHT="150"> </TD>
  16.  
  17.     <TD VALIGN="TOP">
  18.  
  19.         <CFFORM ACTION="InsertAction.cfm" METHOD="POST">
  20.         
  21.         <FONT FACE="Helvetica" SIZE="-1">
  22.  
  23.         <P>First Name<BR>
  24.         <CFINPUT TYPE="TEXT" NAME="FirstName" REQUIRED="YES" MESSAGE="You must enter a first name."></P>
  25.         
  26.         <P>Last Name<BR>
  27.         <CFINPUT TYPE="TEXT" NAME="LastName" REQUIRED="YES" MESSAGE="You must enter a last name."></P>
  28.         
  29.         <P>Title<BR>
  30.         <INPUT TYPE="TEXT" NAME="Title"></P>
  31.         
  32.         <P>Department<BR>
  33.         <SELECT NAME="DepartmentID">
  34.             <CFOUTPUT QUERY="GetDepartments">
  35.                 <OPTION VALUE="#DepartmentID#">
  36.                 #DepartmentName#
  37.             </CFOUTPUT>
  38.         </SELECT></P>
  39.         
  40.         <P><INPUT TYPE="CHECKBOX" NAME="Temporary">Temporary</P>
  41.         
  42.         <P>E-mail<BR>
  43.         <INPUT TYPE="TEXT" NAME="Email"></P>
  44.         
  45.         <P>Phone<BR>
  46.         <INPUT TYPE="TEXT" NAME="Phone"></P>
  47.         
  48.         <P>Start Date<BR>
  49.         <CFINPUT TYPE="TEXT" NAME="StartDate" VALIDATE="date" MESSAGE="Please enter a valid start date."></P>
  50.         
  51.         <P>Personal Information<BR>
  52.         <TEXTAREA NAME="personal" COLS="25" ROWS="5"></TEXTAREA>
  53.         
  54.         <P><INPUT TYPE="SUBMIT" VALUE="Add Employee"></P>
  55.  
  56.         </FONT>
  57.         
  58.         </CFFORM>
  59.  
  60.     </TD>
  61.  
  62.        <TD WIDTH=100 ALIGN="RIGHT" VALIGN="TOP" HEIGHT="150"> </TD>
  63.  
  64. </TR>
  65.  
  66. <TR>
  67.     <TD HEIGHT="35" COLSPAN="3"> </TD>
  68. </TR>
  69.  
  70. </TABLE>
  71.  
  72. <!--- Close the document --->
  73. <CFINCLUDE TEMPLATE="_footer.cfm">