These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Regarding browseForFileToSubmit in LiveCycle Designer

kishil123
Registered: Feb 24 2009
Posts: 7

Hi,

I gone through the posts which are posted in this site for giving permission to the user to select a File from Local Machine.

I am having a Text Field and a Button. I am writing JavaScript on MouseUP of Button.

var f = this.getField("TextField");
f.browseForFileToSubmit();

Its not working when I checked. Can any one help me regarding this. and one more thing some one said to "Enable Use age Rights in Adobe Reader". Is it applicable to what I am doing? If yes then can you suggest me to how to do that also.

I am developing through Adobe Live Cycle Designer 8.0
Please help me to find where I am going wrong.

Thank you

My Product Information:
LiveCycle Designer, Windows
Dimitri
Expert
Registered: Nov 1 2005
Posts: 1389
Hi kishil123,

Here are some JavaScript tutorials from the Learning Center here that should be helpful-

http://www.acrobatusers.com/tutorials/2006/popup_windows_part3

http://www.acrobatusers.com/tutorials/2006/popup_windows_part4

Hope this helps,

Dimitri
WindJack Solutions
www.pdfscripting.com
www.windjack.com
kishil123
Registered: Feb 24 2009
Posts: 7
Hi,
Thanks for your help. But I am unable to find the way.
I gone through the links what you gave. I want to save the file "FileBrowseTest.js.tmp".
Its giving error.I thought there may be some thing with security issue. I went and check in Security Tab.
For PRINTING, CONTENT COPYING, CONTENT COPYING FOR ACCESSIBILITY, FILLING OF FORM FIELDS, its Allowed
For DOCUMENT ASSEMBLY, PAGE EXTRACTION, COMMENTING, SIGNING, CREATION OF TEMPLATE PAGES, its Not Allowed.

And when I go to Acrobat->preference->javascript, I am not able to see the texting.
I gave [b] "app.getPath("app","javascript");"[/b] on mouseUp event for Button2, and when I click on a button its opening a JavaScript Debugger. Its giving [b]" NotAllowedError: Security settings prevent access to this poroperty or method. App.getPath:1:XFA:FORM[0]:BODY[0]:Button1[0]:mouseUp".[/b]
[b] "app.getPath("app","javascript");"[/b] is not recognising in LiveCycle.

I am not sure where i am doing wrong.
Dimitri
Expert
Registered: Nov 1 2005
Posts: 1389
Hi kishil123,

I missed the part of your post that said you are developing in LiveCycle Designer. Those articles I pointed to and the browseForFileToSubmit function are for Acrobat PDFs, not LiveCycle Designer PDFs.

LiveCycle Designer and Acrobat are 2 completely different software programs and the resulting PDFs from each are not interchangeable between the two programs as far as programming/development goes. There are scripting methods and functions in Acrobat that won't work in a LiveCycle Designer PDF and visa versa.

app.getPath is a priviledged operation and can only be used in a trusted function- a button event is not a trusted location.

You can ready about Trusted functions in Acrobat here-
http://www.acrobatusers.com/tutorials/2008/10/using_trusted_functions


Hope this helps,

Dimitri
WindJack Solutions
www.pdfscripting.com
www.windjack.com
kishil123
Registered: Feb 24 2009
Posts: 7
What code can I write on a button for "browse" in LiveCycle Designer 8.0
Dimitri
Expert
Registered: Nov 1 2005
Posts: 1389
Hi kishil123,

There is no equivalent for that function in LiveCycle Designer. It's only available in Acrobat JavaScript which is a different animal than LiveCycle Designer JavaScript. It was up to the developers of those two separate programs what JS functionality they would include, and you've run into one that is in Acrobat but not LiveCycle Designer.

Hope this helps,

Dimitri
WindJack Solutions
www.pdfscripting.com
www.windjack.com
kishil123
Registered: Feb 24 2009
Posts: 7
Hi,

I didn't find [b]config.js[/b] in [u]C:\Program Files\Adobe\Reader 8.0\Reader\Javascripts[/u].
Do I need to create a new one, if so how can I create one.
if not where should i find that file. I am trying to follow your steps. But i am unable to do so.
Please advise me how can I find Config.js and modify that.

Thank you