Skip to main content
Participating Frequently
June 22, 2023
Question

Javascript - Email Button, based off of radio button Selection, and select email subject

  • June 22, 2023
  • 1 reply
  • 1463 views

Hello, 

I have a form that I want to send VIA a submit button to a variable email address based off of an earlier selection in a radio button. 

I am new to JavaScript, This is what I have so far, although I know this is not correct. 

this.submitForm(
"mailto:mm@mycom.com?" +
"&cc=123@abc.com" +
"&subject= [ID CODE] + "[Customer Name]"
);
cSubmitAs:"PDF"
});

What I need to happen is below.

My form has a radio selection button with 5 options
If option 1 is selected then email 1@abc.com + CC anna@abc.com
If option 2 is selected then email 2@abc.com + CC anna@abc.com
and so on...

for the subject line I want it to pull 2 fields from the form Client Number + Client Name after Template Submission
For Example Client Number is 1234 and name is Joe Smith 
The subject should read Template Submission 1234 - Joe Smith

And lastly I need the attachment of the form to be PDF version 

Thank you in advance for your expertise!

This topic has been closed for replies.

1 reply

try67
Community Expert
Community Expert
June 22, 2023
Participating Frequently
June 22, 2023

Thank you, I did locate this on my search but so far have not been successful in executing the javascript. I keep getting Syntax errors that I don't know how to fix. 

try67
Community Expert
Community Expert
June 22, 2023

Post the code you're using and we'll help you fix it.