Skip to main content
christoffers26069125
Participant
February 2, 2017
Answered

Need help with a email script

  • February 2, 2017
  • 1 reply
  • 604 views

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

This topic has been closed for replies.
Correct answer try67

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


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;

}

1 reply

try67
Community Expert
Community Expert
February 2, 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...

christoffers26069125
Participant
February 3, 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

try67
Community Expert
Community Expert
February 3, 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.