Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.
SOLVED

email address determined by radio button

Avatar

Level 4

Hi all!

I am trying to code some javascript that depending on the radio button I choose will determine which email address my form goes to.  I think I am close but I am missing something.  When I click the email button it always moves the radio button to position 1 and we only get the 1st emails.  Here is what I have.

var oDoc = event.target;

if (Campus.rawValue = "1"){

    oDoc.mailDoc({

                            bUI: true,

                            cTo: "mrbecker@uillinois.edu;" + "giftadministration@uif.uillinois.edu;" + "COI@uiuc.edu",

                            cSubject:  EmployeeName.rawValue + " Donor Conflict of Interest Form  ",

                            cMsg: "Additional comments:"

                            })}

                           

else if (Campus.rawValue = "2"){

    oDoc.mailDoc({

                            bUI: true,

                            cTo: "mrbecker@uillinois.edu;" + "giftadministration@uif.uillinois.edu;" + "COI@UIC.edu",

                            cSubject:  EmployeeName.rawValue + " Donor Conflict of Interest Form  ",

                            cMsg: "Additional comments:"

                            })}

                           

else if (Campus.rawValue = "3"){

oDoc.mailDoc({

                            bUI: true,

                            cTo: "mrbecker@uillinois.edu;" + "giftadministration@uif.uillinois.edu;" + "COI@UIS.edu",

                            cSubject:  EmployeeName.rawValue + " Donor Conflict of Interest Form  ",

                            cMsg: "Additional comments:"

                            })}

Thanks for your help!

Jodi

1 Accepted Solution

Avatar

Correct answer by
Level 10

Hi,

The first thing I see is that you use wrong operators.

if(Campus.rawValue = "1") has to be if(Campus.rawValue == "1")

View solution in original post

2 Replies

Avatar

Correct answer by
Level 10

Hi,

The first thing I see is that you use wrong operators.

if(Campus.rawValue = "1") has to be if(Campus.rawValue == "1")

Avatar

Level 4

That was it!!! thank you so much!  Who would have thought one equal sign would cause so much problems.

Thank you again!!