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

Interactive Forms that sums up a client order from catalogue

Vijee
Registered: Oct 1 2009
Posts: 9
Answered

Hi,
I’m a newbie so please bear with my questions/ignorance.

I would like to create an interactive form in a multi-page format. I would like to display our fifty odd products, divided into 5 different categories. The client browses through these pages then selects those that he wants to buy.

The interactive form should display the client’s choices along with the Total purchase order.

In short, a little like a on-line catalogue and cart/basket that we see while buying online.

I have acrobat Pro with Lifecycle Designer. Am not certain if this is even possible on Acrobat. Can someone please help me with my question?
Thanks in advance.

Vijee

My Product Information:
Acrobat Pro 9.0, Windows
Dimitri
Expert
Registered: Nov 1 2005
Posts: 1389
Hi Vijee,

You can certainly do this and it is possible to do with either an Acrobat or LiveCycle Designer form. It will require form design skills and some scripting but pretty much all the resources you need can be found at this site. There are some very good on-demand videos on creating forms in LiveCycle Designer and Acrobat that you should watch and you should browse through the Learning Center for articles on creating forms and JavaScript. If you are unsure whether you want to use an Acrobat form or LiveCycle Designer form here is a blog entry by Carl Young with links for articles that will help you with that decision (http://www.acrobatusers.com/blogs/pdftrainer/welcome-new-acrobat-form-creators )
Once you've spent a few hours on reading and start creating your first form, this forum will be useful for getting help with specific point questions as you move along in the form devlopment process.

Oh, you may also find the brochure/catalog sample PDF files at www.pdfpictures.com interesting to get an idea of what you can do with PDFs.

Hope this helps,

Dimitri
WindJack Solutions
www.windjack.com
www.pdfscripting.com
gkaiseril
Expert
Registered: Feb 23 2006
Posts: 4307
Adobe included a catalog with the full Acrobat version 4.0 as a sample. I have previously posted a revision to correct an error in the example and load the item data from an array.

You will have to login to [url=http://forum.planetpdf.com/webboard/wbpx.dll/~planetpdfforum]Planet PDF Forums[/url] in the non-dynamic version and then search for 'catalog gkaiseril' and select the 'Sample ?' topic. There is also an attached revised catalog file.

I will try to post a copy on Acrobat.com when I have access to service.

[url=https://share.acrobat.com/adc/document.do?docid=fbf8850c-4ece-4bd8-ad41-fc347504c08c]Sample Adobe Store[/url]

George Kaiser

Vijee
Registered: Oct 1 2009
Posts: 9
Hello gkaiseril,

I just saw your link Sample Adobe Store and this is exactly what I want for my catalogue.

Please have a look at the catalogue I've created here at :
http://www.upperside.fr/vijee/mpls09ex/EXHIBITOR%20SPECIAL%20ORDERS2010.pdf

as you can see, I've got the sub taotal, sum, vat total etc. but what i'd like is to have an order form that resembles yours, ie only those items that have = or > 1 value even appear on the order form.Can you please tell me how I can go about it? Thank you so much for responding.
Vijee
gkaiseril
Expert
Registered: Feb 23 2006
Posts: 4307
Each item has a button that adds that item to the order form. The form has all of the code that initializes all the item numbers, description and price. The 'trick' is that the all of the fields associated with an item are hierarchically named and the number of the fields for the item is the lowest level of the name and this information is obtained by scripting and then used to obtain the number, description and price from the internally stored table.

Much of the code is contained in the document level scripts.

George Kaiser

Vijee
Registered: Oct 1 2009
Posts: 9
Hi gkaiseril,

Thank you so much for your email. I saved your sample store as a pdf, opened it in my acrobat and did 'edit or add a field' in order to see the field properties. So far so good.

The problem is when I click under properties for each field I don't see any scripts either under validate or calculate tabs, and no actions either. Am I doing something wrong?

Also, how do I access the document level scripts?

Sorry to bother you like this, but please bear with me as I've only had acrobat for less than a week or so.

Thanks again.
Vijee
Dimitri
Expert
Registered: Nov 1 2005
Posts: 1389
Hi Vijee,

You can access Document Level scripts from the Advanced -> Document Processing -> Document JavaScripts menu.Hope this helps,

Dimitri
WindJack Solutions
www.windjack.com
www.pdfscripting.com
Vijee
Registered: Oct 1 2009
Posts: 9
Hi Dimitri,

Thanks for your email. Really appreciate your help.

I had tried accessing Document level scripts like you said before my last post....and all that happens is that under Documents Javascripts menu, I have a window that pops up with Javascript functions as window name, then it prompts me asking script name, on my right I have buttons close, add, edit, delete, but the latter three are greyed out.

I tried typring in the name of a field and I now have a choice between close and add...;edit and delete are still greyed out.

Thanks again for your continued help on this.

Vijee
gkaiseril
Expert
Registered: Feb 23 2006
Posts: 4307
You should be able to select from the list of document level scripts and then use the edit button to open the selected script in the JavaScript editor, see [url=http://www.acrobatusers.com/tutorials/2007/07/js_document_scripts]Entering Document Scripts[/url] by Thom Parker. You will have to look at the properties of the various fields to see what script functions are being called.

For example, the script for each 'Buy it!' button has the following script for the 'Mouse Up' action:
var thename = this.getField(event.target.name);N = thename.name.substring(4,thename.name.length);AddToCart(N);

The first line obtains the specific button field that was pressed and released, the buttons are named 'Buy.#' where '#' is the number of the button. The second line gets the '#' value from the depressed button's name. and the last line calls the document level script 'AddToCart' and passes the number of the button that was pressed. The number of the button corresponds to the row of the item number list, item description list, and item price list.

There is also a hidden template that holds the lists of the item nubmers, descriptions, and prices. On the order page there is a hidden field that tracks the number of ordered items.

This uses some very advanced coding and field naming techniques that are not always clear to the reader.

George Kaiser

Vijee
Registered: Oct 1 2009
Posts: 9
Hi gkaiseril,

Thanks so much for taking the time out to explain all this to me. In fact I was experiencing some problems on my trial version of the acrobat and that's why I couldn't see the scripts under each field properties. But now that's sorted, I can see your scripts.

I have two questions which I assume are inter-related. I would like to know how I can go about creating the hiden templates that holds my list of item numbers, desc. etc? And also how do I create the hidden fields that tracks the number of ordered items?

Once again thanks a million for helping me.

Vijee
Vijee
Registered: Oct 1 2009
Posts: 9
Hi again gkaiseril,

I've been trying to recreate your scripts using my field variables. I have seen the 4 docu level scripts
AddToCart
DeleteThisItem
GetFieldIndex
LoadData
and am recreateing them in my document, and am in the process of setting up the field properties.

I'm not getting the javascript window box that asks 'how many xxxx items to do you want?' when I click on 'buy' button in my document........;;;I did give the mouse up action as run a javascript and copied the code to it, but on preview when I click on 'buy', nothing happens.

Vijee
Vijee
Registered: Oct 1 2009
Posts: 9
Hi gkaiseril,

In your adobe sample store, when I click on form properties on 'ItemPrice' fields I see no values, but when it's under pdf preview I can see that they have different values. I thought we can put default values under 'options' in form properties, but in your fields I see nothing under options.

Can you please help me with this?
And can you please let me know the name of a book that I have to have in order to create a sample store like yours, ie, with the order form at the end.

Your answers have been clear and you've helped me a lot but I'm going to need some more help from examples if I'm ever going to finish my store, so any advice on this would be much appreciated.

Thanks a lot once again for all your help.
Vijee
gkaiseril
Expert
Registered: Feb 23 2006
Posts: 4307
That form was written with Version 4 of Acrobat, and some or the newer versions might not pickup the convenience shorter methods for the computation. The original PDF used the 'Value is the Sum (+) or the following fields:' and then used the appropriate fields.

George Kaiser

Vijee
Registered: Oct 1 2009
Posts: 9
Hi gkaiseril,

I would very much appreciate it if you would have a look at the store I've created here at:
http://www.upperside.fr/vijee/mpls09ex/newstore.pdf

I've tried to create using your scripts and order form. Please bear with me as this is just a trial version and I'm trying to learn before I do my actual store. Obviously I will not be using your order form in any future work. I've used it here just to demonstarte my question.

First of I combined both our pdfs into one pdf document, then I deleted your pages, and the items listed in your store. In document scipts, under 'LoadData', I input my data instead of the one existing for your adobe store. But still when I click on 'hire' button (which replaced your 'Buy' button) I still get your store items and not mine;-( And in the pdf 'reader' view, I can't see the item numbers/description or the item prices. even though the fields exist.

My question is, where are the items being loaded from if not from the 'Loaddata' document script? And How can I get my products to be listed when the client clicks on 'hire'? and so consequentially how to make them appear on the order form at the end?

Thanks so much for all your help.
best regards,
Vijee