Help! Need chosen value in form to add text in body of submitted email

I have an old form and script I cobbled together a while ago I’ve been using to add info to the subject lines of email my teachers send me when they need help.

Now, years later, I want to add a new function.
If for Service Type: a teacher selects Event/Presentation Services, in addition to the subject additions, I need to add an event form to the body of the submitted email.

How do I do that?

The code for the email form is quite long. Please use FORMCODE in any examples and I’ll replace that with the actual code when I’m experimenting.

Below is the form and script as it is currently used.

<form onsubmit="return process();">
Service Type:&nbsp;
  <select name="type" id="type" required>
  <option value="" selected="selected">Choose service type...</option>
  <option value="[COMP]">Computer Service </option>
  <option value="[CUST]">Custodial Service</option>
  <option value="[EVNT]">Event/Presentation Services</option>
  </select><br>
  <i><small>  Note: If you select Event/Presentation <br>
  you will get an immediate reply <br>
  with a simple form to fill out.</i></small>
  <br>
Building:&nbsp;
  <select name="code" id="code" required>
  <option value="" selected="selected">Choose your building...</option>
  <option value="KS">Kinnikinnick School (KS)</option>
  <option value="LW">Ledgewood School (LW)</option>
  <option value="RMS">Roscoe Middle School (RMS)</option>
  <option value="SC">Stone Creek School (SC)</option>
  <option value="DO">District Office (DO)</option>
  </select>
  <br>
Room Number:&nbsp; <input name="room" id="room" type="text" required><br>
  <br>
  Service Request <br>
  will continue in email... <br>
  <input value="Continue" type="submit">&nbsp;&nbsp; <input value="Reset" type="reset"> <br>
</form>




<script>
function process()
{
var url="https://mail.google.com/a/kinnschools.org/?view=cm&fs=1&to=support@kinnschools.org&su=" + document.getElementById("code").value +("-")+ document.getElementById("room").value +(" - ")+ document.getElementById("type").value +("   ")+ new Date();
location.href=url;
return false;
}
</script>

I’ve edited your post for readability. When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make easier to read.

Note: Backticks are not single quotes.

See this post to find the backtick on your keyboard. The “preformatted text” tool in the editor (</>) will also add backticks around text.

markdown_Forums