Expand my Community achievements bar.

SOLVED

Radio Button to Open Form

Avatar

Level 2

Hello all. I'm looking for some advice and how-to.

I have created several LC forms. When a particular radio button is clicked in Form1, I would like Form2 to open. I would also be willing to move the content from Form2 to Form 1 and just "jump" to that section.

I don't have a lot of coding knowledge, so I tried to use FormCalc (instead of JavaScript) to run the Get command, but it keeps returning the error "Error attempting to read from file...". Then I abandoned that route to try the seemingly more simple route of Flowed subforms. However, it does not appear that I can change the layout of objects. I've spent about two months creating these forms and associated databases with a particular layout.

Are either of these a viable option for my problem? If so, how do I effectively use scripts or how do I manipulate the layout?

Thanks in advance!

Catherine

1 Accepted Solution

Avatar

Correct answer by
Level 5

HI,

Using this path you need to make it into a JavaScript path

Original

K:\Catherine\Ex_Forms\Supplement_1_AffectiveDisorders_07_06_11.Ex.pdf

Becomes

/K/Catherine/Ex_Forms/Supplement_1_AffectiveDisorders_07_06_11.Ex.pdf

My Code looked like this (I don't have a K drive to test with)

app.openDoc ({cPath: "/c/Catherine/Ex_Forms/Supplement_1_AffectiveDisorders_07_06_11.Ex.pdf" });

and this opened the document as expected.

Hope this helps

Malcolm

View solution in original post

8 Replies

Avatar

Level 3

Hi Catherine -

I don't know how to jump to a location or easily transfer data, but to open another form you need this code:

app.openDoc("path/filename.pdf");

You should be able to associate that to a "change" or "click" event.  I use it on an "enter" event on a form to auto open an instrcution form.

Avatar

Level 2

Now it's going through the file name and picking out pieces it doesn't like. It was written like this:

K:\Catherine\Ex_Forms\Supplement_1_AffectiveDisorders_07_06_11.Ex.pdf

and had an error near ':'

So I took "K:\" out. Then it had an error near "\" so I went in and changed those all to /. Now it has an error near "Catherine"

Avatar

Level 3

Here is the syntax I use - it works as long as the file is in this path!

app.openDoc("/win/cmrr/cmrr/public/Pretend Car AP.pdf");

Instead of using a drive letter use the fully formed path for that network location, and try these / instead of \

Avatar

Level 2

I still can't get it to work. I've tried everything I can think of to find the full path and both / and \. Everything with / produces the accessor error. Everything with \ just slowly picks apart the file name one piece at a time with the "syntax error near token..." error.

Do I need to extend the featuers to reader before opening it in pro or reader?

When I use the built in help feautre, it says that I need to put .rawValue after the file name in the parentheses and take out the quotation marks. Any experience with that?

Beyond the initial problem (and maybe this is better off in a different forum):

Maybe it's a version problem. Do you know what version you run? It looks like I have ES 8.2. The preview tab in it only works when I have Reader X installed. When I have Reader 9 is installed, I get a blank error message and it won't load the view. However, I can't open forms created in my version of LiveCycle in Reader X; I get the same blank error message and it won't open the file.

When I called the help desk at our office, the operator told me that it just wasn't meant to be for me...

Avatar

Level 3

"just wasn't mant to be"  LOL!!

I use ES2 9 and Acrobat 9.  I know I had no luck with it when I was trying to open a non-PDF, but when it was a PDF it works everytime. I believe this should work in 8.2, although I have seen posts of users complaining that in Readr 9 and X openDoc is a little flaky.

Do you have sample code loaded when 8.2 loaded?  Might be in the Adobe\Live Cycle Designer\EN\Samples\Form Snippets directory.  For 9 there is a form snippet names "LaunchApp.xdp" that contains the code for opening a PDF.  I think this is all XML material so might be a bit different in 8.2.

Have you tried opening a different PDF?  I would try a simple path to a local PDF.  There may be something in that PDF that is hanging this as well.

Avatar

Level 2

I found the Snippet file you told me about and followed it. Same errors. I also tried using a file that I know the file path and I know that it's a pdf. No luck.

The trend seems to be that if I use the quotation marks around the file path and name, I get the accessor unknown message. If I use the .rawValue that Adobe recommends in all of it's tutorials/manuals/help files, I get the syntax near token error.

In the end, I really do appreciate you heping me with this. You responded really quickly with a wealth of knowledge. But I think I'm going to put this project on a back burner, maybe even in the fridge, for little while.

Again, thanks, and good luck with your future Adobe projects!

Avatar

Correct answer by
Level 5

HI,

Using this path you need to make it into a JavaScript path

Original

K:\Catherine\Ex_Forms\Supplement_1_AffectiveDisorders_07_06_11.Ex.pdf

Becomes

/K/Catherine/Ex_Forms/Supplement_1_AffectiveDisorders_07_06_11.Ex.pdf

My Code looked like this (I don't have a K drive to test with)

app.openDoc ({cPath: "/c/Catherine/Ex_Forms/Supplement_1_AffectiveDisorders_07_06_11.Ex.pdf" });

and this opened the document as expected.

Hope this helps

Malcolm

Avatar

Level 2

Hi Malcom,

Thanks for the input. It works perfectly now!

A couple of notes to future users:

Make sure you have .pdf (or whatever the file type is) at the end of the file name.

Make sure your slashes are going in the correct direction, forward not back (/)

There is only one slash at the beginning of the server name, not two like you have when you're working in a browser window

Again, thanks to both of you for working with me through this!

- Catherine