Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Need help with a email script

New Here ,
Feb 02, 2017 Feb 02, 2017

Hi i made a button who triggers outlook to open a mail. but my problem is that it works even when all the required fields isnt filled out.

My current code is

this.mailDoc(true, "",

"cc@mail.com", "" ,"Titel","Standard text in mail");

had to not use the preset email function becouse i wanted it to only set reciptents in CC and not the to field.

Anyone know what code i can use to implement this feature? im compleatly new to this and would love to get some help

TOPICS
Acrobat SDK and JavaScript , Windows
542
Translate
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 , Feb 03, 2017 Feb 03, 2017

Execute this JavaScript code:

for (var i=0; i<this.numFields; i++) {

    var f = this.getField(this.getNthFieldName(i));

    if (f==null) continue;

    f.readonly = true;

}

Translate
Community Expert ,
Feb 02, 2017 Feb 02, 2017

You can use the mailto syntax to do that... Try this:

mailto:?cc=cc@mail.com&subject=Titel&body=Standard text in mail

The alternative is to perform the validation of the required fields using a script. I've posted code that does that to the forums multiple times in the past. You can search for it...

Translate
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 ,
Feb 02, 2017 Feb 02, 2017

hi, i Cant seem to find ur former post about validating the required fields.. as the first option did not work for me. Ive also gotten another request, When the users press the email button i want to to lock the form and not be editable for the ones who recive it. The people who recieve the email are using foxit reader and adobe reader

Translate
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
Community Expert ,
Feb 03, 2017 Feb 03, 2017

Using Reader you can't really lock the form fields, unless you use a digital signature field. The best you can do is set them as read only.

I'm not sure what will work and what won't work in Foxit Reader, though.

Translate
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 ,
Feb 03, 2017 Feb 03, 2017

okey. how do i set them as read only? Becouse my problem is that im goin to add a verson of the pdf to my company website, then some users are gonna fill it out and then sendt it out to the persons affected. so what i need is that when the users who fill out the form is pressing my mail button it get sent to the other users in a read only format. if you understand

Translate
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
Community Expert ,
Feb 03, 2017 Feb 03, 2017
LATEST

Execute this JavaScript code:

for (var i=0; i<this.numFields; i++) {

    var f = this.getField(this.getNthFieldName(i));

    if (f==null) continue;

    f.readonly = true;

}

Translate
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