• Global community
    • Language:
      • Deutsch
      • English
      • EspaƱol
      • FranƧais
      • PortuguĆŖs
  • ę—„ęœ¬čŖžć‚³ćƒŸćƒ„ćƒ‹ćƒ†ć‚£
    Dedicated community for Japanese speakers
  • ķ•œźµ­ ģ»¤ė®¤ė‹ˆķ‹°
    Dedicated community for Korean speakers
Exit
0

Checkbox Value returns "undefined" in email body

New Here ,
Apr 08, 2019 Apr 08, 2019

Copy link to clipboard

Copied

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.

TOPICS
Acrobat SDK and JavaScript , Windows

Views

250

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Apr 08, 2019 Apr 08, 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";

Votes

Translate

Translate
Community Expert ,
Apr 08, 2019 Apr 08, 2019

Copy link to clipboard

Copied

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";

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 08, 2019 Apr 08, 2019

Copy link to clipboard

Copied

LATEST

Worked like a charm! Thank you so much!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines