Expand my Community achievements bar.

Applications for the 2024-2025 Adobe Experience Manager Champion Program are open!

If expression

Avatar

Former Community Member
Is it possible to have an If expression that states that if a user clicks no to a radio button, the form gets submitted by email?
6 Replies

Avatar

Former Community Member
Yes, you should be able to code this using some JavaScript in Designer.



Mike

Avatar

Former Community Member
Thanks. Could you direct to where I could find similar code?



Thanks again.

Sarah

Avatar

Former Community Member
Not sure where you'd find this. Possibly in the help documentation, maybe on the LiveCycle developer center?



http://www.adobe.com/devnet/livecycle/



Mike

Avatar

Former Community Member
It's possible - could be kinda tricky though. Depends on how you have your form set up and how you have the email functionality setup. Could you give more details on how the radio button and the emailing interact or are set up on your form?

Avatar

Former Community Member
Right now, I just have several questions in two groups. Each gets answered with simple radio buttons.



Group 1: If the user clicks no to any of the first group, I have a popup box stating that they are not eligible to participate in the study.



Group 2: In the second group, if the user clicks yes to any of the questions, they too, get the popup stating that they will not be allowed to participate in the study.



If they get the popup at any point, I would like that info to be sent with the submit button.



If Group 1 questions are all answered Yes and Group 2 question are all answered No, then the user may participate in the study and needs to answer one more question. All this information needs to get sent when hitting the submit button.



I hope this doesn't confuse you. Does it answer your questions or do you need more information. Let me know - and thank you.

Avatar

Former Community Member
Put this script into the click event of your radio button group:



if (exclusionGroup.rawValue == 2) {

emailSubmit.execEvent("click")

}



The script is JavaScript and I've named the radio button group exclusionGroup; I've named the email submit button emailSubmit. Make sure you give each radion button group a unique name, and alter the script accordingly. Further, in this case, the value for "no" in my button group is 2, double check the Binding tab under the Object tab to verify the value of your "no" button.