Skip to main content
Participant
April 8, 2019
Answered

Checkbox Value returns "undefined" in email body

  • April 8, 2019
  • 1 reply
  • 500 views

Hello I'm trying to have a checkbox, when not checked display a message in the email body, but all I get is "undefined".

var WI="Inventory Control - This  includes Warehouse Inventory and Rental Inventory";

var cb1 =  this.getField("WI-U").value;

     if ( cb1 =="Off") WI.value;

var cToAddr ="Email@Company.com"

var cSubLine =""

var cBody = "Thank you for completing the file. \n\n"

+ cb1.value + "\n"

when the check box is off I need it to display plain text from var WI in the body of the email.

Any assistance is greatly appreciated.

This topic has been closed for replies.
Correct answer try67

I think this is what you meant to do:

var WI = "Inventory Control - This  includes Warehouse Inventory and Rental Inventory";

if (this.getField("WI-U").valueAsString=="Off") WI = "";

var cToAddr = "Email@Company.com";

var cSubLine = "";

var cBody = "Thank you for completing the file. \n\n" + WI + "\n";

1 reply

try67
Community Expert
try67Community ExpertCorrect answer
Community Expert
April 8, 2019

I think this is what you meant to do:

var WI = "Inventory Control - This  includes Warehouse Inventory and Rental Inventory";

if (this.getField("WI-U").valueAsString=="Off") WI = "";

var cToAddr = "Email@Company.com";

var cSubLine = "";

var cBody = "Thank you for completing the file. \n\n" + WI + "\n";

Ryno556Author
Participant
April 8, 2019

Worked like a charm! Thank you so much!