Answers.Body: <blockquote>
    <p>But, is it possible to do this when there is another contact form on the site? </p>
  </blockquote>
  
  <p>Yes?</p>
  
  <blockquote>
    <p>If so, what do I need to add to the department dropdown code?</p>
  </blockquote>
  
  <p>The dropdown code shouldn't have anything to do with it, if I'm following you correctly.</p>
  
  <p>Both forms just need to have a <code>toEmail</code> hidden input as specified in the docs: <a href="https://github.com/pixelandtonic/ContactForm#dynamically-adding-email-recipients-requires-craft-25" rel="nofollow noreferrer">https://github.com/pixelandtonic/ContactForm#dynamically-adding-email-recipients-requires-craft-25</a></p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-05-06T07:04:22.627Z
Answers.Text: @Stak you can set the `toEmail` value using JavaScript on change of the selected dropdown option. It's probably also possible to dynamically set/override the data from a `contactForm.beforeSend` event listener.
Answers.UserDisplayName: carlcs
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-02-05T10:49:04.213Z
Answers.Text: Great news! So on the dropdown feature, is it possible to have multiple different "toEmail" options, depending on which business they would like the message to go to?
Answers.UserDisplayName: Stak
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-02-05T00:28:18.080Z
Answers.LastActivityDate: 2017-02-05T00:28:18.080Z
Answers.UserDisplayName: Brad Bell
Body: <p>I'm creating a website that has a contact form on two different pages.</p>
  
  <p>I am using the Pixel &amp; Tonic <a href="https://github.com/pixelandtonic/ContactForm" rel="nofollow noreferrer">ContactForm plugin</a> and currently have a working contact form on one page - This one requires the user to provide their name, email, telephone, company name and message.</p>
  
  <p>On the other page, the contact form is different as the user needs to select which department they would like their message to be sent to. For example:</p>
  
  <pre><code>  &lt;div class="select-wrapper"&gt;
     &lt;select name="department" id="department"&gt;
      &lt;option value=""&gt;- Please Select -&lt;/option&gt;
        &lt;option value="one"&gt;Business One&lt;/option&gt;
        &lt;option value="two"&gt;Business Two&lt;/option&gt;
        &lt;option value="three"&gt;Business Three&lt;/option&gt;
        &lt;option value="four"&gt;Business Four&lt;/option&gt;
     &lt;/select&gt;
   &lt;/div&gt;
  </code></pre>
  
  <p>In the README document for this plugin, I can see that it is possible to programatically add email recipients by adding a hidden input field named “toEmail” and changing the craft/config/contactform.php config file</p>
  
  <p>But, is it possible to do this when there is another contact form on the site?
  If so, what do I need to add to the department dropdown code?</p>
  
Tags: <plugin-contactform>
Title: Multiple contact forms - Different recipients
ThreadText: # Multiple contact forms - Different recipients
  
  (Asked by: username_0 on 2017-02-04)
  
  I'm creating a website that has a contact form on two different pages.
  
  I am using the Pixel & Tonic [ContactForm plugin](https://github.com/pixelandtonic/ContactForm) and currently have a working contact form on one page - This one requires the user to provide their name, email, telephone, company name and message.
  
  On the other page, the contact form is different as the user needs to select which department they would like their message to be sent to. For example:
  
  ```
    <div class="select-wrapper">
     <select name="department" id="department">
      <option value="">- Please Select -</option>
        <option value="one">Business One</option>
        <option value="two">Business Two</option>
        <option value="three">Business Three</option>
        <option value="four">Business Four</option>
     </select>
   </div>
  
  ```
  
  In the README document for this plugin, I can see that it is possible to programatically add email recipients by adding a hidden input field named “toEmail” and changing the craft/config/contactform.php config file
  
  But, is it possible to do this when there is another contact form on the site?
  If so, what do I need to add to the department dropdown code?
  
  **Tags:** plugin-contactform
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2017-02-05. Score: 3
  
  > But, is it possible to do this when there is another contact form on the site?
  
  Yes?
  
  > If so, what do I need to add to the department dropdown code?
  
  The dropdown code shouldn't have anything to do with it, if I'm following you correctly.
  
  Both forms just need to have a `toEmail` hidden input as specified in the docs: <https://github.com/pixelandtonic/ContactForm#dynamically-adding-email-recipients-requires-craft-25>
  
  > **Comments:**
  > **username_0**: Great news! So on the dropdown feature, is it possible to have multiple different "toEmail" options, depending on which business they would like the message to go to?  
  > **username_2**: @username_0 you can set the `toEmail` value using JavaScript on change of the selected dropdown option. It's probably also possible to dynamically set/override the data from a `contactForm.beforeSend` event listener.  
  
  ---
  
  