Skip to content

Instantly share code, notes, and snippets.

@jjpmann
Created November 30, 2015 14:30
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 jjpmann/fd32eda66400395925cb to your computer and use it in GitHub Desktop.
Save jjpmann/fd32eda66400395925cb to your computer and use it in GitHub Desktop.
embed of dynamic contact form
# Team Listing
{exp:channel:entries channel="team"}
<div>
<h2>{name}</h2>
...
{embed="team/.form-modal" email="{team_email}" id="{url_title}"}
</div>
{/exp:channel:entries}
# Form Modal
{exp:freeform:form
form:id="contact-form-{embed:id}"
admin_notify="{embed:email}"
}
<fieldset>
<legend>I'll Call You</legend>
<div class="form-row">
<label for="{embed:id}-first-name">First Name</label>
<input type="text" name="first_name" id="{embed:id}-first-name">
</div>
<div class="form-row">
<label for="{embed:id}-last-name">Last Name</label>
<input type="text" name="last_name" id="{embed:id}-last-name">
</div>
<div class="form-row">
<label for="{embed:id}-phone">Phone</label>
<input type="text" name="phone" id="{embed:id}-phone" class="phone-mask">
</div>
<div class="form-row radio">
{freeform:field:best_time_to_reach_you attr:class="selectBox-dropdown" attr:id="{embed:id}-reach-you"}
</div>
<div class="form-row">
<input type="submit" class="btn btn-secondary" value="Submit" />
</div>
</fieldset>
{/exp:freeform:form}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment