<p>You can do this with the default Email Dropdown field (no JS needed!). The Email Dropdown field lets you create a mapping between an item in the dropdown and an email:</p>

<pre><code>Website Issues: websupport@mywebsite.com
Information: info@mywebsite.com
</code></pre>

<p>The Email Dropdown field obscures those emails in your template. And when you set up your Notification Email, you can reference your Email Dropdown field by its handle in your Recipients setting: <code>{emailDropdownFieldHandle}</code></p>

<p>In the case you ever did wish to add JS to your templates, the best way to add it to your template is to use <a href="https://sprout.barrelstrengthdesign.com/docs/forms/template-overrides.html" rel="nofollow noreferrer">Template Overrides</a>.</p>

CC BY-SA 4.0
2018-08-23T22:34:51.150Z
2018-08-23T22:34:51.150Z
Ben Parizek
<p>I'd like to be able to attach custom JS to a Sprout Form which can be managed in the form builder. I need to add logic that will switch the email address of the recipient based on a choice from a select menu. For example, "Website Issues" goes to "websupport@mywebsite.com", and "Information" goes to "info@mywebsite.com".</p>

<p>Ideally this JS would be managed at the form builder level so it only loads for that specific form.</p>

<p>I'm in the testing phase of Sprout Forms, so I apologize if I'm missing something obvious.</p>

<plugin-sproutforms><javascript>
Can I add custom JS to Sprout Form?
# Can I add custom JS to Sprout Form?

(Asked by: username_0 on 2018-08-23)

I'd like to be able to attach custom JS to a Sprout Form which can be managed in the form builder. I need to add logic that will switch the email address of the recipient based on a choice from a select menu. For example, "Website Issues" goes to "websupport@mywebsite.com", and "Information" goes to "info@mywebsite.com".

Ideally this JS would be managed at the form builder level so it only loads for that specific form.

I'm in the testing phase of Sprout Forms, so I apologize if I'm missing something obvious.

**Tags:** plugin-sproutforms, javascript

---

## 1 answers

### Answer by username_1 on 2018-08-23. Score: 1

You can do this with the default Email Dropdown field (no JS needed!). The Email Dropdown field lets you create a mapping between an item in the dropdown and an email:
Website Issues: websupport@mywebsite.com
Information: info@mywebsite.com

The Email Dropdown field obscures those emails in your template. And when you set up your Notification Email, you can reference your Email Dropdown field by its handle in your Recipients setting: {emailDropdownFieldHandle}
In the case you ever did wish to add JS to your templates, the best way to add it to your template is to use Template Overrides.


---

