Skip to content

Instantly share code, notes, and snippets.

@neokoenig
Created March 25, 2011 11:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save neokoenig/886729 to your computer and use it in GitHub Desktop.
Save neokoenig/886729 to your computer and use it in GitHub Desktop.
<cfoutput>
<cfif params.action EQ "add">
<h2>Add a New Contact</h2>
#startFormTag(class="generic", id="contact-edit", action="create")#
<cfelse>
<h2>Editing Contact</h2>
#startFormTag(class="generic", id="contact-edit", action="update", key=params.key)#
</cfif>
#errorMessagesFor("contact")#
#select(objectName="contact", property="prefix", includeBlank=true, options=application.oii_contacts.prefixes, label="Prefix", title="Optional prefix, such as Dr, Professor etc")#
#textField(objectName="contact", property="firstname", label="First Name *", class="required", minlength="2", title="First Name, required, needs as least 2 chars")#
#textField(objectName="contact", property="middlename", label="Middle Name", title="Middle Name, optional")#
#textField(objectName="contact", property="lastname", label="Last Name *", class="required", minlength="2", title="Last Name, required, needs as least 2 chars")#
<!--- snip... --->
<div id="emails">
#includePartial(contact.emailaddresses)#
</div>
<a href="" id="addnewemail" class="button">Add Another Email</a>
<!--- Categories ---->
<cfloop query="categoryTypes">
#hasManyCheckBox(label=name, objectName="contact", association="categories", keys="#contact.key()#,#categoryTypes.id#")#
</cfloop>
#submitTag(class="edit", value="Update Contact")#
#endFormTag()#
<!---Hidden DOM Templates --->
#includePartial("emailaddressTemplate")#
</cfoutput>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment