I am trying to use an ajax auto-complete value to us an if value post hook to determine who to send the emails to. Basically we have created a form that uses a simple ajax auto-complete. See the Form:
http://excelerondesigns.com/~bristolm/index.php?id=10
Each association has three TV's attached to them( Targeted Email Addresses) We need to have the TV's values pulled to determine where the email is routed to.
Any Idea's?
Here is the formit Code:
[[!FormIt?
&hooks=`email,redirect`
&postHooks=`getEmailAdd`
&emailTpl=`wo-form-tpl`
&emailTo=`
[email protected]`
&redirectTo=`1`
&validate=``
]]
<form action="[[~[[+id]]]]" class="form-2" method="post">
<fieldset>
<div class="row">
<label for="id-30">Association:<span class="required">*</span></label>
<div class="ac-item">
<input type="text" class="autocomplete" id="id-30" placeholder="Write the Association" data-path="[[~43]]" name="association" value="[[+association]]" />
<div class="ac-holder"></div>
</div>
</div>
<div class="row">
<label for="fName">First Name:<span class="required">*</span></label>
<input type="text" name="fName" id="fName" value="[[!+fi.fName]]" />
</div>
<div class="row">
<label for="lName">Last Name:<span class="required">*</span></label>
<input type="text" name="lName" id="lName" value="[[!+fi.lName]]">
</div>
<div class="row">
<label for="address">Street Address:<span class="required">*</span></label>
<input type="text" name="address" id="address" value="[[!+fi.address]]" />
</div>
<div class="row">
<label for="city">City:<span class="required">*</span></label>
<input type="text" name="city" id="city" value="[[!+fi.city]]" />
</div>
<div class="row">
<label for="zip">Zip:<span class="required">*</span></label>
<input type="text" name="zip" id="zip" value="[[!+fi.zip]]" />
</div>
<div class="row">
<label for="phone">Phone Number:<span class="required">*</span></label>
<input type="text" name="phone" id="phone" value="[[!+fi.phone]]" />
</div>
<div class="row">
<label for="email">E-Mail:<span class="required">*</span></label>
<input type="text" name="email" id="email" value="[[!+fi.email]]" />
</div>
<div class="row">
<label>Work Order Type:<span class="required">*</span></label>
<select name="type">
<option>Select One</option>
<!--<option value="Select One">Select One</option>-->
<option value="Irrigation"[[!+fi.type:FormItIsSelected=`irrigation`]]>Irrigation</option>
<option value="Landscaping"[[!+fi.type:FormItIsSelected=`landscaping`]]>Landscape</option>
<option value="Pest Control"[[!+fi.type:FormItIsSelected=`pestControl`]]>Pest Control</option>
<option value="Security"[[!+fi.type:FormItIsSelected=`security`]]>Security</option>
<option value="Street Lights"[[!+fi.type:FormItIsSelected=`streetLights`]]>Street Lights</option>
<option value="Other"[[!+fi.type:FormItIsSelected=`other`]]>Other</option>
</select>
</div>
<div class="row">
<label for="details">Work Order Details:<span class="required">*</span>
<span>(Please specify the location)</span></label>
<textarea name="details" id="details" value="" cols="30" rows="10">[[!+fi.details]]</textarea>
</div>
<div class="btn-row">
<button class="submit" type="submit">submit</button>
<button class="reset" type="reset">reset</button>
</div>
</fieldset>
</form>