Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.

Possibility of a "browse button"?

Avatar

Former Community Member
Hello everyone in the user to user adobe forums,



I was wondering is it possible to add a "browse button" to a pdf form I have created that would allow users to attach another pdf document along with the form. Both the files-the attached and the filled out pdf file-would have to send when the submit button is clicked. The submit button e-mails the document to a specified e-mail address.



Is this possible?



Thank you For your Time,



Todd C. Bey
24 Replies

Avatar

Former Community Member
Have you tried using the following?



app.execMenuItem("AddFileAttachment");



Rocky

Avatar

Former Community Member
thank you so much, this works.



I guess a simple javascript code does the trick eh?

Avatar

Former Community Member
IS there anyway to spcify it as a .pdf file so it doesn't allow you to add every filetype.

Avatar

Former Community Member
Is it possible to limit the filetype to certain extentions?

Avatar

Level 7
If there is no input parameter for the file type for the method, then no. But you might be able to write a plug-in.

Avatar

Former Community Member
but why wouldn't there be a parameter for the file type if there is a parameter for browse?

Avatar

Level 7
I am not the programer of the function or an Adobe employee, but from my experience writing functions, it is easier to program a logical value to test than the build a file path statement for multiple OSs.

Avatar

Former Community Member
so how should i go about programming a logical value to test?

Avatar

Level 7
Create a variable with a value of true or false, you can then use an "if(logical comparison)" statement to check the value by just using the variable name for the logical comparison statement.



Example:



var Valid = true;

console.show();

console.clear();

console.println("Test of Valid")



function Test(bValid){

if (bValid)

console.println("Valid is true");

else

console.println("Valid is false");

return;

}



Test(Valid);

Valid = false

Test(Valid);

Test(!Valid)

Avatar

Former Community Member
but how would you use that checking mechanism to filename extentions?

Avatar

Former Community Member
those lines of code don't make sense, how would it check the filename?

Avatar

Level 7
That is an example of setting a logical parameter.



If you want a browse button, you will need to write a plug-in for Acrobat/Reader.

Avatar

Level 7
If you do not like Acrobat, try Novel's Tumbleweed, an alternative multi platform viewer or write your own.



All software has short comings.