Skip navigation
tmg72
Currently Being Moderated

calculation script with multiple conditions

Sep 16, 2011 7:25 AM

Hi. I am recreating an order form in Livecycle. I'd like to auto-populate some of the pricing info on the bottom based on data input on the top half of the form.

I've tried several different sets of code, and come up with nothing that works.

 

Here's an example scenario:

 

If the checkbox for "offshore" and "bolting" is checked, the numeric field associated with bolting should be $50 * whatever number is in the bolting quantity box.


So i need the script to check the offshore checkbox, and the bolting checkbox, assign a value to the numeric field and multiply it by another numeric field.

 

 

There is the added complication of some customers having custom pricing, so I'd need to also figure out a code that is based on the customer selection.

 

I also thought about, perhaps, putting the price info in drop down lists and enabling/disabling them based on the checkboxes up top.

 

 

Ideally, though, the first scenario would be my preference.

 

I tried this code (and many other variations of it) in both javascript and formcalc...in formcalc i get an error about the &.

 

if (offshore == 1) && (bolting == 1) then
$.rawValue == $50.00
elseif
(inland == 1) && (bolting == 1) then
$.rawValue == $50.00
elseif
(land == 1) && (bolting == 1) then
$.rawValue == $55.00
elseif
(rig == 1) && (bolting == 1) then
$.rawValue == $50.00
elseif
(plant == 1) && (bolting == 1) then
$.rawValue == $50.00
elseif
(yard == 1) && (bolting == 1) then
$.rawValue == $55.00
else
$.rawValue = 0
endif

 

 

any help would be appreciated!

 
Replies
  • Currently Being Moderated
    Sep 22, 2011 8:37 AM   in reply to tmg72

    You need more parenthesis.      

     

    if ((offshore==1) && (bolting==1)){

    //do stuff

    }

     
    |
    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