Skip navigation
Currently Being Moderated

JavaScript debugging in FD7.0

Feb 14, 2005 1:30 AM

Hi,

Im currently creating a few forms in FD 7.0. I need to use JavaScript to do a few calculations and validations. It appears however, that the JavaScript debugger is only available in Acrobat professional and not in the forms designer?

Can anybody point me in the direction of sample code in Javascript/

Thank You

Petrus
 
Replies
  • Currently Being Moderated
    Feb 17, 2005 10:35 AM   in reply to (Petrus_Kruger)
    Hi,

    not sure how much javascript you know, but here are a couple tips:

    1. put a try/catch around your javascript to display error messages:

    try {
    some code
    } catch(e) {
    app.alert(e);
    }

    2. fields on your form can be referenced directly:

    total_price.rawValue = item_total.rawValue + tax_total.rawValue;

    inaddition, forms can be directly referenced as
    xfa.form....

    3. form designer has a fairly intuitive context menu available when you reference fields.

    4. when two or more objects have the same name, you can use all.item.

    eg. Have two pages on the form, both with subForms called page.
    then,
    page.all.item(0).total_price.rawValue refers to the total_price field on page 1.

    5. to reference xml data fields:

    this.rawValue = xfa.record.sales.sales_items.all.item(i).books.value;

    hope that helps.
     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)