4 Replies Latest reply on Nov 10, 2015 4:13 AM by try67

    Help with document level scripts and functions

    MJG123

      Hi there,

      In an effort to try and tidy up some of my earlier programming efforts I tried using document level javascripts and then trying to call that function to deliver the variables I declared in the function. But as you can guess, it is not working. :-)

       

      So basically the function I created has a few e-mail address set a variables.

      On my form I have  four buttons. Depending on which button you click, it will open the e-mail, set the To address, the CC address, subject line and the contents of the body of the mail.

       

      On the specific button I have:

      email(); \\this is the document level script function I created

      this.mailDoc({bUI: true, cTo: cMail, cSubject: cSubline, cMsg: cBody});

       

      It is telling me that my first variable cMail is not defined. This variable is declared in the function.

      Why does this not work?