For some reason, my forms are going to all addresses rather than the one that mailSelector specifies.
My call:
[!eForm? &formid=`contactForm` &subject=`Contact Form` &to=`[email protected],[email protected]` &mailSelector=`recipient` &tpl=`contactForm` &report=`contactFormReport` &gotoid=`31` !]
My form:
<p>All fields with an (<span class="required">*</span>) are required</p>
<form method="post" action="[~[*id*]~]" enctype="multipart/form-data">
<div><input type="hidden" name="formid" value="contactForm" /></div>
<dl>
<dt><label for="recipient">Department <span class="required">*</span></label></dt>
<dd><select name="recipient" id="recipient">
<option value="0">Choose Recipient</option>
<option value="1">Geophysics</option>
<option value="2">Business Development</option>
<option value="3">Field Operations</option>
</select></dt>
<dt><label for="job">Job <span class="required">*</span></label></dt>
<dd><input type="text" id="job" name="job" size="61" eform="Job:html:1" /></dd>
<dt><label for="name">Name <span class="required">*</span></label></dt>
<dd><input type="text" id="name" name="name" size="61" eform="Name:html:1" /></dd>
<dt><label for="email">Email Address <span class="required">*</span></label></dt>
<dd><input type="text" id="email" name="email" size="61" eform="Email Address:email:1" /></dd>
<dt><label for="phone">Phone</label></dt>
<dd><input type="text" id="phone" name="phone" size="61" /></dd>
<dt><label for="comments">Comments <span class="required">*</span></label></dt>
<dd><textarea id="comments" name="comments" rows="8" cols="59" eform="Comments:html:1" ></textarea></dd>
<dt><label for="attachment">Resume</label></dt>
<dd><input class="field" type="file" name="attachment" id="attachment" eform="Attachment:file:0:Only upload of text documents are supported:#LIST pdf,txt,doc,docx " /></dd>
</dl>
<p class="submit"><input type="submit" name="submit" value="Submit!"></p>
</form>
<p class="required">[+validationmessage+]</p>
The only thing I am doing that would be different than normal, is that I am passing two variables from the job application page to the form. I am carrying over the job title as well as ’recipient’ value. The variables make it to the form so I assume it does not interfere with eForm since the script has already done its job.
Here is that JS code for passing variables, just in case...
<script type="text/javascript">
//<![CDATA[
var windowOnloads = window.onload ;
window.onload = function () {
if (typeof windowOnloads == 'function') {
windowOnloads();
}
populateFields();
}
function populateFields() {
var query = location.href.split('?');
var values = query[1].split('&');
var fields = new Array();
var pair;
for (var k in values) {
pair = values[k].split('=');
fields[pair[0]] = pair[1];
}
document.getElementById('job').value = unescape(fields['job']);
document.getElementById('recipient').value = unescape(fields['recipient']);
}
//]]>
</script>
Any suggestions or help would be greatly appreciated. Thanks in advance....