Skip to main content
Known Participant
September 5, 2024
Answered

Send to different emails dependent on a radio button when using the submit button

  • September 5, 2024
  • 1 reply
  • 1121 views

Hello,

I have an Examination Request Form. There are several entry options for name, course exam and radio buttons for the exam type. Each entry option is dependent on whether the user enters a name for that row. At the bottom, there is a Submit button, which sends to one address.

 

I need to make it send to one address if the radio button for Exam Type is "Retest" or "Re-certify" and a DIFFERENT email address if the radio button is "Instructor Qualification."

 

The trick is that there are four optional rows where this could happen. Right now, the 2nd-4th rows have a validation script on the "Test-Taker Name" field: var bRequired = event.value !=event.target.defaultValue;
this.getField("2nd Test-Taker Email Address").required = bRequired;
this.getField("2nd Exam Choice").required = bRequired;
this.getField("2nd Test-Taker Exam Type").required = Required;
this.getField("2Proposed Exam Date").required = bRequired;

 

Would it be easier if I changed the Exam Type from a group of radio buttons to a drop-down menu?

Right now, the "Retest" button makes the "Original Date" field a required field.

 

I've seen good answers for different emails based on drop-down choices, but there was no mention of a Submit button and I can't figure out how to make this work for my situation.

 

Best regards,

Christine Shell

This topic has been closed for replies.
Correct answer PDF Automation Station

I'm still confused. I can't figure out where to enter the export information in the options tab of the radio button choices. I've attached the file in the hopes you can help me. I really appreciate your help so far. I am sorry I don't understand.


In form editing mode, right-click > properties on the field, then go to the options tab:

However, I thought you were using a script in the Submit form button:  Mouse Up > Run a Javascript:

this.mailDoc();

1 reply

PDF Automation Station
Community Expert
Community Expert
September 5, 2024

Dropdown or group of radio buttons doesn't matter.  You should put the email addresses as the export values and then pull the the value from the radio button or group or the dropdown into the cTo parameter of the mailDoc method:

this.mailDoc({cTo: this.getField("Instruction Qualification").value});

Known Participant
September 5, 2024

Thank you so much! I'm sorry to ask stupid questions, but where do I enter the export values?

PDF Automation Station
Community Expert
Community Expert
September 5, 2024

With a radio button it's in the options tab of the properties and it's called Radio button choice.