Skip to main content
Participant
January 19, 2021
Question

Submitting form depending on what's selected in dropdown list

  • January 19, 2021
  • 1 reply
  • 403 views

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

This topic has been closed for replies.

1 reply

try67
Community Expert
Community Expert
January 19, 2021

This tutorial was made for you: https://acrobatusers.com/tutorials/dynamically-setting-submit-e-mail-address

To summarize, you can place the email address as the export value of the items in your drop-down and then use the field's value directly in your code as the value of the cTo parameter.

TreeishAuthor
Participant
January 19, 2021

Thanks for your reply, very much appreciated. I'll have a read through this and try to decipher..will take a bit of trial and error!

Thanks again