Skip navigation
Currently Being Moderated

Binded based on dropdown values in a flowable table

Apr 26, 2012 7:24 AM

Tags: #pdf #adobe #pdf_fillable_forms #getting_started #livecycle_forms

Can someone please help me with my practice form?  I am just started learning to make a fillable pdf form. I made my practice form patterned after the Purchase Order Form sample that came with livecyle installation.  I want my table to automatically display the unit price when I select an item from the dropdown list.  I managed to do that by using below script.  The problem comes in when I am adding rows my selection keeps on reverting back to the first item on the dropdown list or on my first selection on the first row. Should I add something on below script.  Please help.

 

menu.JPG

 

RefreshmentOrderform.RefreshmentOrder.details.detail[0].item::change - (JavaScript, client)

 

 

unitprice.rawValue = this.boundItem(xfa.event.newText);

 

unitprice.value = xfa.event.newText;

 
Replies
  • Currently Being Moderated
    Apr 26, 2012 2:51 PM   in reply to omeng414

    Omeng,

    I'm moving your discussion to the Acrobat forms forum, since this is not related to the CreatePDF service.

    Dave

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 26, 2012 3:00 PM   in reply to Dave Stromfeld

    Actually, it should be transferred to the LiveCycle Designer forum, since

    this form was not created in Acrobat.

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 26, 2012 3:14 PM   in reply to Gilad D (try67)

    Thanks, Try.

    Moving to Designer.

    Dave

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 27, 2012 3:54 PM   in reply to omeng414

    Hi,

     

    This could be a problem with your binding (check the binding tab of the object pallete) in that each field in all the rows are bound to the same element or you could have a default value set, or ... Maybe if you can host your form somewhere like Acrobat.com and post the link here we can get a better idea.

     

    Good luck

     

    Bruce

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 28, 2012 3:20 PM   in reply to omeng414

    Hi,

     

    The problem you are having is because the id values of the drop down are duplicated, if I choose cherry slice I get an id of 3 (which is meant to mean $3.00) but this is also the id of Ambassador (as well as Brownies and Coffee).  So similar problem with Chocolate Tarts going to Assorted Mini Cookies.

     

    So you need to keep the id unique.  At first I thought you should set the id to 1,2,3,4,.. and have a table lookup for the price, but I liked your idea of keeping it all in the drop down control, so if you changed the make them unique, something like 1:3.00, 2:1.50, 3:3.00, ... you could strip of the part before the colon by changing your change event code to;

     

    unitprice.rawValue = this.boundItem(xfa.event.newText).split(":")[1];

     

    Which turns the id into an array and takes the second element.

     

    Also, there are some run time errors in your form.  In Acrobat (or Reader) you should turn on "Show console on errors and messages", which is under Preferences ... JavaScript.

     

    The second line in your change event causes a runtime error as the value property of a numeric field is its default value and to correctly reference it you need to use;

     

    unitprice.value.oneOfChild.value

     

    But you don't need that line at all in this case.

     

    There is also a problem with the initialise script in numServiceChargerate, which looks like it is a problem moving from FormCalc in some parts of the form to JavaScript in others, I would try and stick with one or the other.

    

    Good luck

    

    Bruce

    

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points