<!---
contactForm.cfm
author: Leon Chalnick, inspired by Ben Edwards' contact manager
params: request.event

Displays contact page-view (data entry form), loaded with contact data retrieved from
the calling event.

Note that the event to execute next (when the form is submitted) is passed to this 
page-view as an argument of the event named submitEvent.
--->
<cfset contact = REQUEST.event.getArg('contact') />

<cfoutput>
<font color="##FF0000">#REQUEST.event.getArg('message','')#</font>

<table border="0">
<cfform action="index.cfm?event=#REQUEST.event.getArg('submitEvent')#" method="post">
<input type="Hidden" name="ContactID" value="#contact.getContactID()#">
<input type="Hidden" name="id" value="#contact.getContactID()#">
<tr valign="top">
  <td colspan="2">* indicates required field</td>
</tr>
<tr valign="top">
  <td>Name:</td>
  <td><cfinput type="Text" name="FirstName" value="#contact.getFirstName()#" size="25">
      <cfinput type="Text" name="LastName" value="#contact.getLastName()#" size="25" required="Yes" message="Last Name is required">*</td>
</tr>
<tr valign="top">
  <td>Address:</td>
  <td>
      <input type="Text" name="Address" value="#contact.getAddress()#" size="50">
   </td>
</tr>
<tr valign="top">
  <td>City/State/Zip</td>
  <td>
      <input type="Text" name="City" value="#contact.getCity()#" size="25">
      <input type="Text" name="State" value="#contact.getState()#" size="3">
      <input type="Text" name="Zip" value="#contact.getZip()#" size="10">
   </td>
</tr>
<tr valign="top">
  <td>Country:</td>
  <td>
      <input type="Text" name="Country" value="#contact.getCountry()#">
   </td>
</tr>
<tr valign="top">
  <td>Phone:</td>
  <td><input type="Text" name="phone" value="#contact.getphone()#"></td>
</tr>
<tr valign="top">
  <td>E-Mail:</td>
  <td><input type="Text" name="email" value="#contact.getemail()#" size="50"></td>
</tr>
<tr valign="top">
  <td>Login Name:</td>
  <td><cfinput type="Text" name="UserLogin" value="#contact.getuserlogin()#" required="Yes" message="Login name is required">*</td>
</tr>
<tr valign="top">
  <td>Password:</td>
  <td><cfinput type="password" name="UserPassword" value="#contact.getuserpassword()#" required="Yes" message="Password is required">*</td>
</tr>
<tr valign="top">
  <td>Mailing List?:</td>
  <td><input type="Checkbox" name="MailingList" value="true" #iif(contact.getmailinglist(), de("CHECKED"), de(""))#></td>
</tr>
<tr valign="top">
  <td>&nbsp;</td>
  <td>&nbsp;<br>
    <input type="submit" value="#REQUEST.event.getArg('submitLabel','')#">
    <input type="Button" value="Cancel" onclick="location.href='index.cfm?event=#REQUEST.event.getArg('cancelEvent','')#">
    </td>
</tr>
</cfform>
</table>
</cfoutput>
