Skip to main content
danoMonitor
Participant
May 30, 2023
Question

Email List based on checkbox

  • May 30, 2023
  • 1 reply
  • 474 views

Hi,

I have a pdf with check boxes and when the check boxes are ticked and the form is submitted a java script runs and checks which boxes are checked. It will then get the email address from the Value of the checkbox and add it to a var, see my previous post on how I this..

https://community.adobe.com/t5/acrobat-discussions/sharing-info-adobe-javascript-create-email-list-based-on-checkbox-s/m-p/10657788#M221262

 

However now I want to add multiple values like user1@adobe.com; user2@adobe.com

and add to a var.

 

The debugging console has not been helpful at all.

 

if(this.getField("SiPics").value == "Off"){
    var ePics = ";"
} else {
    var ePics = this.getField("PICS").value + ";"
}

if(this.getField("ESignoff_Lab").value == "Off"){
    var eLab = ";"
} else {
    var eLab = this.getField("ESignoff_Lab").value + ";"
}

if(this.getField("ESignoff_Rad").value == "Off"){
    var eRad = ";"
} else {
    var eRad = this.getField("ESignoff_Rad").value + ";"
}

if(this.getField("EOrder_Rad").value == "Off"){
    var eORad = ";"
} else {
    var eORad = this.getField("EOrder_Rad").value + ";"
}

if(this.getField("EOrder_Lab").value == "Off"){
    var eOLab = ";"
} else {
    var eOLab = this.getField("EOrder_Lab").value + ";"
}

if(this.getField("PH").value == "Off"){
    var ePharm = ";"
} else {
    var ePharm = this.getField("PH").value + ";"
}

if(this.getField("eProsafe").value == "Off"){
    var ePsafe = ";"
} else {
    var ePsafe = this.getField("eProsafe").value + ";"
}

if(this.getField("CW").value == "Off"){
    var eWins = ";"
} else {
    var eWins = this.getField("CW").value + ";"
}

if(this.getField("CK").value == "Off"){
    var eMosa = ";"
} else {
    var eMosa = this.getField("CK").value + ";"
}

if(this.getField("MedTech").value == "Off"){
    var eMedT = ";"
} else {
    var eMedT = this.getField("MedTech").value + ";"
}

if(this.getField("DH").value == "Off"){
    var eIntV = ";"
} else {
    var eIntV = this.getField("DH").value + ";"
}

if(this.getField("GP").value == "Off"){
    var eGp = ";"
} else {
    var eGp = this.getField("GP").value + ";"
}

if(this.getField("IV").value == "Off"){
    var eIntra = ";"
} else {
    var eIntra = this.getField("IV").value + ";"
}

var eTrain = "user1@someplace.com" + ";" + "user2@someplace.com"

var GroupCC = ePics + eLab + eRad + eORad + eOLab + ePharm + ePsafe + eWins + eMosa + eMedT + eIntV + eGp + eIntra

var eSub = "IT Access form for - " + this.getField("FirstName").value + " " + this.getField("LastName").value + " " + this.getField("Date2").value

var eMsg = "Message in bidy of email from The IT Team" 

var eTo = this.getField("ManagerName").value

this.mailDoc({bUI:true, cTo:eTo, cCc:GroupCC, cBcc:eTrain, cSubject:eSub, cMsg:eMsg})

 Any help would be appreciated

This topic has been closed for replies.

1 reply

try67
Community Expert
Community Expert
May 30, 2023

This code is not ideal, but it should work. What happens when you use it? What's the issue?

danoMonitor
Participant
May 30, 2023

This commonly referred to a PICNIC issue, Problem In Chair Not In Computer - I went over the code again and found 1 mistake. Now tis all working as it should. Thanks for getting back to me 👍