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

I want UnitPrice to be read only

ctv
Registered: Aug 23 2010
Posts: 1

I need an order form that has the unit price as read only, so the customer only has to enter the quantity and the amount (Quantity * UnitPrice) will automatically be calculated. I don't want the customer to be able to change the unit price. Can this be done?

Bamboolian
Registered: Jul 27 2010
Posts: 48
Hi,

What kind of design are you thinking and what tools are you using?
I'll write assuming that you're using livecycle designer since your writing to livecycle forum.

If your form is to have fixed unit price fields for each materials, then all you need to have is readonly numeric field for unit price having default value.
you can do so by
1. change object type to numeric ; Object -> Field -> Type : numeric
2. set to readonly ; Object -> Value -> Type : Readonly
3. set unit price to default value ; Object -> Value -> Default :If you are planning to have dropdown field to make user select the material, then either you can include the information in dropdown, or you can link the unit price to another field depending on the selection made in dropdown.
to include the information in dropdown;
1. change object type to dropdown ; Object -> Field -> Type : dropdown
2. Set list material name including unitprice to display list (i.e "Material 1 @ USD50.00"); Object -> Field -> List Items +
3. Set the unit price that will be used in actual calculation in Item values ; Object -> Binding -> Specify Item Values checkThen you'll have unit price displayed with your material name and in your calculation codes, you can refer just to the unit price by using DropDownList.rawValue.


The other way will be to change other field depending on materail selection.
pretend you have dropdown for material selection and numeric field for unit price.
You will have to write some code like following to your material dropdown change event.

switch (xfa.event.newText){case "Material 1" :NumericField1.rawValue = 10break;case "Material 2" :NumericField1.rawValue = 15break;default :NumericField1.rawValue = 0}

in anyways, you will have to fix your designs first.
Hope it'll help.