Copy link to clipboard
Copied
Hi there, I am making a fillable form and want to include buttons with website links as reference information for internal use. But i only want these to be seen internally, I have the buttons set so they do not print but I am looking to have it set as well that when it is sent as an email attachment the buttons don't appear. Does anyone know how to do this? Help is appreciated. Thank you!
Copy link to clipboard
Copied
You need to attach the code to a submit button, as I've explained before.
Copy link to clipboard
Copied
You can do that if the file is submitted from a button within it. Then you could use that button to first hide to hide those other buttons.
Another option could be to add a script to the file that checks the presence of something like a global variable and if that variable is not present it hides the buttons (or the other way around, shows them if the variable is present), and then define this variable on all of your own machines.
Copy link to clipboard
Copied
So I would have to create a submit button and hide it? I don't know much about javascript. Do you have any instructions and advice? Thank you so much, this gives me hope that it is possible!
Copy link to clipboard
Copied
Yes, you can use a button that executes this JavaScript code (or something like it) as its Mouse Up script:
this.getField("Button1").display = display.hidden;
this.getField("Button2").display = display.hidden;
this.getField("Button3").display = display.hidden;
this.getField("SubmitButton").display = display.hidden;
this.mailDoc({cTo: "target_email@server.com"});
Replace the field names in the first lines with the actual ones from your file, and the email address in the last line with the one you want to send the file to.
Copy link to clipboard
Copied
Will the email thing work when there is multiple users in an organization and will be using the form individually to send through their personal email address? For example: this form is available to all staff and they can click on the button for links, then click the other email button to send to their own email without the buttons showing and send out externally....And stupid question, the "button1" would just be the name you changed it to? For example: if my button is renamed 'print' I put ("print") ? I hope that makes sense
Copy link to clipboard
Copied
Yes, and yes.
Copy link to clipboard
Copied
So I went to my executing button for the other two I want hidden, properties, actions, mouse up, run a java script, add, typed in the script with my other two button names and the target_email@server.com and closed. They are completely gone from the pdf. I need to see those buttons while in the form. Do I have to run another actions or have anything else ticked off?
I wrote the script together under the third button . Sorry for all the questions I really don't know much about javascript
Copy link to clipboard
Copied
You only need one script, under the Submit button. You don't need to apply anything to the other buttons.
You can make them visible again by going to their Properties and changing this setting there, under the General tab.
Copy link to clipboard
Copied
Ahhhhhh it seems to have worked thank you thank you!! I hope you don't mind one more question. How can I lock the information I put into my fillable text boxes so when it goes to an email attachment the person it is sent to can't edit it... if that is possible.
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Thank you once again!! I will try setting it tomorrow.
Copy link to clipboard
Copied
Hi again, can you explain how I would set up the second option of the variable you were referring to? Now that I think about it the other way a third party could possibly see the buttons is if our staff saved the file and then sent it as an email from there, it would probably show the buttons. So the ultimate goal is that if the document leaves our organization, we don't want it having buttons or links. Is that possible?
Copy link to clipboard
Copied
You can remove them entirely.
Buttons can be removed like this:
this.removeField("FieldName");
Links are a bit trickier. You can use this code to remove all links in the file:
for ( var p = 0; p < this.numPages; p++) {
var b = this.getPageBox("Crop", p);
this.removeLinks(p, b);
}
Copy link to clipboard
Copied
Where would I input the script on my file?
I tried looking under file properties but I am not sure
Copy link to clipboard
Copied
Never mind I found the javascript tool lol
Copy link to clipboard
Copied
So I input the script together with the javascript tool and put it under document javascript. It just deleted my buttons for a blank page but I need to still view them until they are either emailed or saved a different name etc
Copy link to clipboard
Copied
You need to attach the code to a submit button, as I've explained before.
Copy link to clipboard
Copied
Oh ok I thought we were adding it to the whole file to detect if the variable is present on the machine.So if someone forgets to press the submit button before saving it, it will still keep the buttons and links
Find more inspiration, events, and resources on the new Adobe Community
Explore Now