473,386 Members | 1,828 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Adobe LiveCycle Designer scripting problems

Using Adobe LiveCycle Designer, I can't get the script below to work using "formcalc" (a type of Javascript). I use this to calculate shipping costs for
car club items by their weight in a pdf form.

I'm only able to get the correct postage for the weights in lines 3,5 and 7 below. If I select an item that weighs between 0.11 and 0.25, the form calculates it as 2.25 instead of 1.90. Also, if the item weighs 2.51 or more,
it only calculates it as 7.00 instead of 9.00.
Expand|Select|Wrap|Line Numbers
  1.                 if        (ShpWt >= 0.01 <= 0.10) then 
  2.              PostageSH = 1.90
  3.         elseif  (ShpWt >= 0.11 <= 0.25) then 
  4.              PostageS = 2.25
  5.         elseif  (ShpWt>= 0.26 <= 0.75) then
  6.               PostageSH = 4.00
  7.         elseif  (ShpWt > 0.76 <= 2.50) then
  8.             PostageSH = 7.00
  9.         elseif  (ShpWt >= 2.51) then
  10.             PostageSH = 9.00
  11.         endif
  12.  
Please suggest any script changes that will calculate the postage as illustrated.

Thanks in advance,

Mike
Mar 4 '10 #1

✓ answered by gits

according to the FormCalc-reference a correct if-statement with a logical AND should look like:

Expand|Select|Wrap|Line Numbers
  1. if ( ShpWt >= 0.01 & ShpWt <= 0.10 ) then
  2.     ...
  3. elseif ...
  4.  
kind regards

5 7690
elseif, then and endif don't exist in javascript. Also you forgot the logical OR operator (||) in your if statements and the second part of your if statements doesn't make sense unless you restate the variable you're comparing (in your case, ShpWt).
Mar 5 '10 #2
gits
5,390 Expert Mod 4TB
according to the FormCalc-reference a correct if-statement with a logical AND should look like:

Expand|Select|Wrap|Line Numbers
  1. if ( ShpWt >= 0.01 & ShpWt <= 0.10 ) then
  2.     ...
  3. elseif ...
  4.  
kind regards
Mar 5 '10 #3
Thank you for posting the sample FormCalc script reference. That was just the bit of information I needed to get my form to work properly.
Mar 8 '10 #4
For anyone else having a similar question regarding FormCalc, here is the final scripting that worked for me:

Expand|Select|Wrap|Line Numbers
  1.     if ( ShpWt == 0 ) then
  2.         PostageSH = 0.00 
  3.     elseif ( ShpWt >= 0.01 & ShpWt <= 0.10 ) then 
  4.           PostageSH = 1.90 
  5.        elseif ( ShpWt >= 0.11 & ShpWt <= 0.25 ) then  
  6.                                   PostageSH = 2.25 
  7.                 elseif ( ShpWt >= 0.26 & ShpWt <= 0.75 ) then 
  8.                                   PostageSH = 4.00      
  9.     elseif ( ShpWt >= 0.76 & ShpWt <= 2.50 ) then 
  10.                                   PostageSH = 7.00 
  11.     elseif ( ShpWt >= 2.51 ) then 
  12.                                  PostageSH = 9.00 
  13.         elseif ( ShpWt == 0 ) then
  14.                    PostageSH = 0.00 
  15.     endif
Mar 8 '10 #5
gits
5,390 Expert Mod 4TB
Thank you for posting the sample FormCalc script reference. That was just the bit of information I needed to get my form to work properly.
no problem ... even when it was no JavaScript question :) ... glad to hear that you got it working now :)

kind regards
Mar 8 '10 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Jens S0nderby Munk | last post by:
Hi, I'm having some problems with the Reponse.BinaryWrite, IE 6.0 and Adobe Reader 6.0. When I try to write a pdf-file to an IE browser with a Adobe Reader 6.0 installed then it just displays a...
1
by: MuZZy | last post by:
Hi, I just wonder if someone has any idea where i could get description of Adobe SDK functions translated to C#/VB.NET? The problem is this: we have an C#/VB.NET app which uses Acrobat COM...
19
by: Dales | last post by:
I have a custom control that builds what we refer to as "Formlets" around some content in a page. These are basically content "wrapper" sections that are tables that have a colored header and...
2
by: Diffident | last post by:
Hello All, Our development environment is Visual C#.NET and we develop applications based on client/server model. We have installed Adobe's SDK, Acrobat Professional 7.0 and Adobe Designer 7.0 ...
3
by: Legi | last post by:
Well I have very very simple problem. I have three NumericFields prepeared id Adobe Designer. I would like to add values from thirs two fields and show sum in the third one. So I'm choosing...
1
by: Tom S. | last post by:
I have found that with Adobe LifeCycle Design 7.x, you can save a dynamic PDF that will send xml to the browser when a button is clicked. I'm able to pull the data I need from the xml I'm sent,...
0
by: s.danyal.k | last post by:
Hi All, I have made an application that loads an Adobe Acrobat file and shows it. For this I ve used Adobe ActiveX Control available in C#. Heres a sample code. I am adding the control...
4
Tovah137
by: Tovah137 | last post by:
I am trying to create a program of sorts in Adobe Livecycle 8.0, I want to make a message box pop up when you click on certain things asking "have you checked for ____", I want to be able to click...
3
by: GavReynolds | last post by:
Hi All I'm a bit lost......Was just wandering where i could post a question regarding a piece of code im using in Adobe LiveCycle Designer? Any help would be much Appreciated! Cheers Gav
1
by: Rossouw | last post by:
I a working in Adobe LiveCycle Designer ES, and I am quite new to it. I have a couple of questions that I want to ask. If somebody know of a good source or a good source of coded examples, then...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.