Expand my Community achievements bar.

Submit to 2nd email address based on check box state..

Avatar

Former Community Member
I'm creating a form that, when filled out, will always need to go to a single email address. If, however, a certain check box is clicked, it would also need to go to a second email address.



Can someone point me in the right direction of how to do this?



Thanks,



Rachael
3 Replies

Avatar

Former Community Member
b You might choose this way to do it:



i // Getting the chosen option in the check box button-group.



> var sOption = xfa.resolveNode("Formulario1.ButtonGroup").rawValue;



i // Establishing the mail address, it will depend of the chosen option



>if( sOption == "1" ){email = "mailto:youremail1@service.com";}



>else if ( sOption == "2"){ email = "mailto:youremail2@service.com";}



i // Submit the PDF form



>if(email != null){



> var doc = event.target;



> doc.submitForm( { cURL: email, cSubmitAs: "PDF" } );



>}



b If you can send the both address Simultaneously, you must specify it in the mailto sentence, for example:



> "mailto:youremail1@service.com,youremail2@service.com, ..."

Avatar

Former Community Member
Thank you for your response. I've just now received more information from my supervisor and it appears that what they need is even more complex. I have only dealt with very simple javascript in acrobat forms in previous versions. So this form designer is completely foreign to me.



Basically, the form I need to create will have many conditional check boxes. Which check boxes are clicked will determine who emails go to when the submit button is clicked. Each check box will have one or more associated email address. In addition, the form will ALWAYS be sent to one address.



I have no idea where to start on coding this. Can someone point me in the right direction to some tutorials maybe on creating a conditional form or a book that covers it well? I seem to be finding alot of information on conditional statements in forms, but nothing that pertains directly to what I'm doing and I don't know how to adapt the code for my purposes.



Thanks,



Rachael

Avatar

Former Community Member
I did get the above code to work. What I'm trying to figure out is how to alter that code to handle multiple check boxes. I don't know how to get it to put all the required email addresses (based on what boxes are checked) into one email.



Any help would be greatly appreciated.



Rachael