Submitting form depending on what's selected in dropdown list
Hi,
I'm new with forms and javascript, so bear with me!
I've managed to set up a form so the submit button sends it to a specified email address using javascript, and I've got that part all working fine (script below).
this.mailDoc({
cTo: "email",
cSubject: this.documentFileName + " from " + this.getField("Supervisors Name").valueAsString + ", " + this.getField("Sitelocation").valueAsString,
cMsg: "A completed Site Compliance Checklist has been submitted from " + this.getField ("Supervisors Name").valueAsString
});
However, this form is to cover five different worksites, and i'd like to use a dropdown list for the user to choose which site they're working on. Depending on what site they then choose from that list, it'll then have a different email address to be sent to.
Can anyone help with how I can set up the submit button so it recognises what option's been chosen from the list, and then be able to send to the corresponding email address?
Happy to clarify further if that isn't quite clear.
Many thanks,
Andy