How do I perform a conditional 'or' calculation in PDF format?

I am trying to create a named calculation that allows my clients to calculate their cost. (The simple sounds... but I'm new to JavaScript so I am struggling to fix it)

Objective: I want the formula to calculate the total price of the customer based on their status as well as Add-ons. So the total will be either reflect a "Non-member" price with modules OR a "Member" price with Add-ons.

Booth price:

Non-members = $900

Member = $750

Add - ons:

Stand angle = $90

Stand Extensions = $95

Here's what I have:

(function () {}

var v1 = (+ getField("Booth_NonMember").value * 900) + (+ getField("Booth_Corner").value * 90) + (+ getField("Booth_Extensions").value * 95);

var v2 = (+ getField("Booth_Member").value * 750) + (+ getField("Booth_Corner").value * 90) + (+ getField("Booth_Extensions").value * 95);

var v3 = (v1: v2);

Event.Value = v3;

})();

The problem is when I enter text in the field for the member price and then add some text in the fields of the add-on denies the member price all together.

So, if I say: I want 1 stand 'Member' ($750) with 1 "Booth Corner" ($90) and 1 "Extensions stand" ($95), the formula says that the total is $ 185 while it should be $935.

am I missing something?

The problem is the value of your v1 whether always true in this test GOLD fields stand has a value, so v1 we will always choose more v2. Try this instead:

(function () {}

var nNonMember = + getField("Booth_NonMember").value;

var nMember = + getField("Booth_Member").value;

var v1 = (nNonMember * 900) + (+ getField("Booth_Corner").value * 90) + (+ getField("Booth_Extensions").value * 95);

var v2 = (nMember * 750) + (+ getField("Booth_Corner").value * 90) + (+ getField("Booth_Extensions").value * 95);

Event.Value = nNonMember > 0? v1: v2;

})();

Tags: Acrobat

Similar Questions

  • How to print a bunch of MBOX files in PDF format?

    I have number of MBOX files exported from Thunderbird mailbox. Of these some MBOX files have critical evidence. I have to present that evidence to the Court in a PDF format. So need a solution on how to change the format of MBOX files? How can I print MBOX in PDF format?

    You can also make use of MBOX to PDF Converter. I found this site software - http://download.cnet.com/MBOX-to-PDF-Converter/3000-2369_4-76284538.html

    Its a tool that facilitates the process and saves a lot of time.

  • How to convert Microsoft Works document in Word or PDF format?

    A document on my computer is in Microsoft Works. Sent in the email that the receiver cannot open. Must be Word or PDF. How can I change the document to one of them?

    * original title - Mailing/opening files / Documents *.

    Copy the text into a word document or
    Use your PDF Creator to convert to PDF format.

  • How can I change a download from Word to PDF format?

    When I tried to open a PDF file from my Bank, a pop-up window declared that it would not recognize a PDF (which has never happened before). So I saved the file in Word. Big mistake as each document that I now open cannot be read. How to reverse or cancel the saved document download format?

    When I type in the PDF, and then on 'Action', nothing happens (ie., not provided with any option). I don't remember if I checked the original "Do this automatically" etc. Could this download doesn't apply only to the site of the Bank? Still, I should be able to solve this problem.
    UPDATE: solved the problem. Thanks for your help!

  • How can I create a new patch custom in PDF format

    I can't find out how to create a new custom patch.  When I try I get a page asking me where and what file I want to open but I do not have any file.  I'm totally confused I'm just going around in circles.  I tried to find info on the web, but it's just as bad.  Can someone help me please.  I want to create a stamp "PAID (with date)."   Don't know why Adobe don't have it on their list as I seem to be the most important of them.

    Thank you

    Roparman

    Hi roparman,

    Please check the details here: https://acrobatusers.com/tutorials/custom_dynamic_stamp

    Thank you

    Abhishek

  • How to convert Word doc with track changes in pdf format?

    How to convert a Word doc with track changes to a pdf file that includes the supplements?

    Hi Planner question,.

    You should be able to use the Save function just as in Word to save directly to PDF with track changes and comments intact.

    Best,

    Sara

  • If an else statement not calculation in pdf format. Help!

    This formula (see below) does not (calculation) result.  What's wrong?

    var a = this.getField ("Positions_Rates");

    var b = this.getField ("Positions");

    If (a.value == '$0 - no position not bought') {}

    (b.value = 0);

    } ElseIf (a.value == $40 Top position 'bought') {}

    (b.value = 40);

    } else {}

    (b.value = 1);

    }

    Then, you must use "event.value" instead of "b.value.

  • How to create a tiff of a page in pdf format?

    Hello

    Acrobat 9 Pro.

    I consult a page that I want to format tiff in a pdf document, how to export just this page to TIFF 600 dpi, 250-page?

    Format tiff image file export has no option to choose just this page, you get all of the 250 which takes forever.

    Envirographics

    My thoughts exactly. I also wrote this code it for you (to the current page):

    var doc = this;

    page var = doc.extractPages (doc.pageNum);

    page.saveAs ({cPath: doc.path.replace (".pdf", "_p" +(doc.pageNum+1) + ".tiff"), cConvID: "com.adobe.acrobat.tiff"});

    page.closeDoc (true);

    You can run it from the console and it will save the TIFF file in the same folder as the original PDF file.

  • How to add images to header and footer in pdf format

    Hello

    I want to add the image in the header and footer for the generation of pdf.

    How can I add to that? Sequel to my xsl

    ? XML version = "1.0" encoding = "UTF-8"? >
    < xsl: stylesheet version = "1.0" xmlns: xsl = "http://www.w3.org/1999/XSL/Transform".
    xmlns:fo = "http://www.w3.org/1999/XSL/Format".
    xmlns:fn = "http://www.w3.org/2005/xpath-functions" >

    < xsl: output method = "xml" Indent = "Yes" encoding = "utf-8" omit-xml-declaration = "yes" / >




    < xsl: template match = "/" >

    < fo:root >

    < fo:layout - master-set >
    < fo:simple - page-master master-name = "my page" >
    < fo:region - body margin = "in 1" / >
    < / fo:simple - page-master >
    < / fo:layout - master-set >

    < fo:page - master-reference sequence = "my page" >
    < fo:flow = "xsl-region-body" flow-name >
    < fo:block >
    < xsl: mode if apply-templates = sΘlectionner 'dump' = ' / session, entity, instance, attribute "/ >
    < / fo:block >
    < / fo:flow >
    < / fo:page - sequence >
    < / fo:root >
    < / xsl: template >





    < xsl: template match = "" * "mode = 'dump' priority ="100">"




    < fo:block >

    < fo:block margin left = "1 cm" >

    "< xsl: for each select="@question-text ">
    "< xsl: value-of select =". » / > =
    < / xsl: foreach >
    < xsl: if test = "string-length (normalize-space (text (())) > 0" >
    < xsl: value - of select = "text ()" / >
    < / xsl: if >
    < / fo:block >





    < xsl: mode if apply-templates = sΘlectionner 'dump' = "*" / >
    < / fo:block >
    < / xsl: template >

    < / xsl: stylesheet >

    Published by: 848231 on April 6, 2011 01:42

    Hello

    Here's a way to put an image in the header:

    
        
          
          
        
      
    
      
         
             
                 
                 
            
        
        
        
      
    

    A good xsl: FO refernce: http://www.learn-xsl-fo-tutorial.com

    I hope this helps.

    Thank you
    Aakarsh

    Edited by: aakarsh April 6, 2011 06:40

  • How to save a photo book spread page in pdf format?

    When you create a book with pages of propagation, saving the page as pdf does not create two pages rather it creates one.

    This overview pdf should work - Preview of a project of printing Photos, iPhoto or Aperture to avoid problems - Apple Support

    LN

  • How to export only odd pages / pair only in PDF format

    I finished a press work whose copy was only on odd pages with a design on even pages (even on pages anyway). After that it was complete, the client decided they wanted a copy with only the odd pages to display on a screen at an event. I was looking for a way to export a PDF of only odd pages, but did not find. It was easy to do with printing in PDF format - here I could print only odd or even pages, or just not to print blank pages (after the removal of the content from the master page even side). Here, I learned that you should always use export instead of printing in format PDF - is - it possible (easy) to accomplish this task with export?

    Here is a link to an effective method to clear unwanted in Acrobat pages:

    remove multiple pages at the same time (change the PDF)

  • How to get documents to open in pdf format. instead of Notepad

    I tried to open a credit card statement, it allows to open in pdf format. But today opens in Notepad, how do I fix it so it opens in pdf format

    I tried to open a credit card statement, it allows to open in pdf format. But today opens in Notepad, how do I fix it so it opens in pdf format

    "open in PDF format?
     
    You mean that you used to have some applications (such as Adobe Reader, CutePDF, FoxIt PDF Reader, etc.) which has been set as the default application to open PDF documents and somehow changed in Notepad?
     
    There are several ways to solve this problem - but here's what I suggest:
    Download and install Adobe Reader.

  • How to accept the General conditions

    Can how I accept terms and conditions? My iPad and my phone ask me ' apple media services terms and conditions have changed.

    before proceeding, you must read and agree to the new terms and conditions

    ccancel/ok

    then nothing

    Hey lindafromnewark,

    I ran into something like this before, and usually a reset will solve the issue.

    You can watch notrestart your iPhone, iPad or iPod touch to see how to reboot your device.

    I'm sure that this will solve your problem.

    See you soon.

  • How can I perform a clean installation of Mac OS x for my iMAC, retina 5K late 2014 with drive of Fusion with the intact Recovery HD partition?

    How can I perform a clean installation of Mac OS x for my iMAC, retina 5K late 2014 with drive of Fusion with the intact Recovery HD partition?

    Pure how to install OSX on a Fusion drive and keep the recovery disc function

    These instructions assume that your iMAC partitions or file systems has been damaged and you want to restore to the way most efficiency with fusion drive and the recovery partition, similar to what was built in the factory.

    These instructions work for the iMAC, retina 5K end 2014 version comes with OSX Yosemite. The scores of major drive of the 128 G SSD and 3 TB of HARD drive has been configured as a logical drive (merger by car).

    WARNING: These instructions here are shared for interest only. Readers to take their own risk by following these instructions. The author is not responsible for any damage caused by following these instructions.

    This is the target disk partitions, and the configuration that we want to achieve.

    Disk0 is the 128 GB SSD - solid state drive and holds the start of the partition (disk0s3)

    Disk1 is the 3.0 to HDD - mechanical transmission and holds the Recovery HD partition.

    There are two EFI partitions to partition table GUID on both hard drives (disk0s1, disk1s1).

    Disk space remaining (partition disk0s2 and disk1s2) are used to create the disc of Fusion 3.1 to named "Macintosh HD".

    / dev/disk0 (internal, physical):

    #: NAME SIZE TYPE IDENTIFIER

    0: GUID_partition_scheme * GB 121,3 disk0

    1: disk0s1 EFI EFI 209.7 MB

    2: Apple_CoreStorage GB LVG 121.0 disk0s2

    3: disk0s3 Apple_Boot Boot OS X 134,2 MB

    / dev/disk1 (internal, physical):

    #: NAME SIZE TYPE IDENTIFIER

    0: GUID_partition_scheme * 3.0 to disk1

    1: EFI EFI 209.7 MB disk1s1

    2: disk1s2 Apple_CoreStorage TB 3.0 LVG

    3: disk1s3 Apple_Boot Recovery 650.0 MB HD

    / dev/disk2 (internal, virtual):

    #: NAME SIZE TYPE IDENTIFIER

    0: Apple_HFS Macintosh HD + 3.1 TB disk2

    Logical volume on disk0s2, disk1s2

    0D807F6E-FB7C-418F-AAF4-EF3EA3525D10

    Fusion unencrypted drive

    Here's how we do it.

    • A. clean reinstallation of Mac OS x.
    • 1. make sure that you back up all your data on the hard drive using Time Machine or other means. The following procedure will delete all data.
    • 2. create the OSX install USB, insert it to the MAC workstation.
    • 3. given that us will be operated on the internal trunk of the reader of the Mac, it must start on OSX install USB (see Y.).
    • 4. in the menu at the top of the screen, select disk utilities.
    • 5. turn highlighted the volume of disk Fusion called "Macintosh HD." Click clear to clean.
    • 6. If his success, then go ahead to install OSX new to that partition, as usual.
    • 7. otherwise, if it does not, that means fusion drive has been damaged.
    • 8 follow the instructions below to fix it.
    • . B. Split disc Fusion in the physical hard disks
    • 1. Since us will be operated on the internal drive of the Mac trunk, assumes that we already have boot up OSX install USB drive (see Y.).
    • 2. in the menu at the top of the screen, select utilities and Terminal.
    • 3. on the screen of the terminal type:
    • Cs diskutil list.
    • You will see something similar to the screen below.
    • 4 copy the long string after Logical Volume and replace the UUID with it in the following command to delete the logical volume of the disc fusion (aka coreStorage of logical volume):
    • diskutil deletevolume cs UUID
    • For example:
    • diskutil deletevolume E59B5A99-F8C1-461A-AE54-6EC11B095161 cs
    • 5 copy the long string after the logical volume group and replace the UUID with it in the following command to remove the drive (aka coreStorage) fusion:
    • diskutil cs remove UUID
    • p. ex. diskutil cs remove E03B3F30-6A1B-4DCD-9E14-5E927BC3F5DC
    • 6. at this stage, the fusion drive has been deleted, and hardsisk SSD and mechanical hard drive will be reappear in diskutil or separate records.
    • 7. If step 5 or 6 takes more than 30 minutes to complete, this means that the fusion drive has been corrupted. You can follow the commands below to clear the table to partition the hard way. First command clears the SSD drive, second command erases the HARD drive.
    • The command does not return a response, after 1 minute, press Ctrl + Z to complete orders. 1 minute is enough data to code and erase the partition table on the disk.
    • cat/etc/random >/dev/disk0
    • cat/etc/random >/dev/disk1
    • . C install a new copy of Mac OS x for the hard drive HDD and tested this disk partition hard recovery work.
    • 1. go on diskutil to create a partition called Macintosh HD HDD hard drive using all the space there.
    • 2 do the same with the mechanical hard drive.
    • 3. follow the usual procedure to boot from the installation of OSX USB and install a new copy of Mac OS x hard disk SSD.
    • 4. This will create the correct priming of the partitions, recovery hard drive partitions and PSX partitions hard disk HDD.
    • 5. once the installation is complete, test if OSX may start successfully, but no need to go through the initial MAC OS x didn't put in place that we're going to waste this and do the installation again later.
    • 6. we must now test if the recovery hard drive partition works.
    • 7. reboot for hard drive recovery (see X - by pressing command and R at the same time during boot right after that you hear sound start and release only a few seconds after you see the apple logo and the progress bar for loading...)
    • 8. it is important to test and make sure that the partition of hard drive recovery.
    • D. recreate the fusion drive
    • 1 since us will be operated on the internal trunk of the reader of the Mac, it must start on OSX install USB (see Y.).
    • 2. in the menu at the top of the screen, select utilities and Terminal.
    • 3
    . on the screen of the terminal type:
  • diskutil list.
  • You should find that we have a list of disk group hard physical volume only, no logic here still.
  • 4. you will see something similar to the screen below.
  • 5. search for the largest partition on the SSD hard drive, which should be close to the maximum size of HDD to the SSD (121 G, for example) and mark the name of the device, this will usually be something like/dev/disk0s2
  • 6. search the largest disk partition mechanical forming fusion with the SSD hard drive. This should be close to the maximum size of the mechanical hard drive (for example 3 TB) hard disk and mark the name of the device, this will usually be something like/dev/disk1s2
  • 7
  • . Now let's create the merger in car (group alias logical volume) in the Terminal, type: diskutil cs create nom_lecteur driveIDs
  • The number of the driveIDs is unlimited, it may be a number of discs, or a number of disk partitions. Always put the faster discs first, for example for our SSD disk0s2
  • For example:
  • diskutil cs create fusiondrive disk0s2 disk1s2
  • diskutil - the version of disk utility command line.
    cs - This calls for Core Storage, which is necessary for the merger.
    create - creates a basic storage group.
    nom_lecteur - is the name of the drive and how you want that he
  • appear in the disk utility (not the Finder - that comes later). You can call it what you like; in our example, we named our Fusion table "Fusion".

  • driveIDs - Here is the Player IDs of the readers you want as part of your Fusion table, separated by a space. In our example, they are 'disk0' and 'disk1', but it may be different in your configuration.
  • It is important that the faster hard drive appears first in the command, which in our case the disk0s2 (a partition in the SSD). In this way, drive fusion will use this disk as primary and the cache. The second disc in the command, in this case disk1s2 (a partition on the HARD disk). The secondary disk (HARD drive) is used to store less frequently used files.  Otherwise, the fusion drive performance will be worse that it is designed for.
  • 8. you will see something like below appear on the screen:
  • Creation Volume logical storage of kernel
  • Move isk0s2 storage of carrots
  • Disk1s2 of switching for the storage of carrots
  • Waiting for logical volume group appear
  • Discovered the new group of logical volumes 'DBFEB690-107B-4EA6-905B-2971D10F5B53 '.
  • Store LVG UUID: DBFEB690-107B-4EA6-905B-2971D10F5B53
  • Finished CoreStorage operation
  • 9 copy to the bottom of the string after "Discovering new Volume Logic Group" using the command + C
  • 10. next, create the partition of the merger (alias logical volume) drive named "Macintosh HD".
  • In the Terminal, type: diskutil createVolume groupString jhfs cs + size volumeName
  • For example:
  • Diskutil createVolume DBFEB690-107B-4EA6-905B-2971D10F5B53 jhfs cs + 'Macintosh HD' 100%
  • diskutil - once again, this is the version of disk utility command line.
  • cs - called the basic storage functions, which are necessary for this arrangement.
  • createVolume - this is the command to create the storage area real for the reader who is represented by an icon on your desktop.
  • groupstring - this is the long alphanumeric string you copied in the previous step. It identifies the table you created such as getting a volume placed on it.
  • jhfs + -the format of the disc. It is Apple (journaled) extended Format, which is recommended for drives with an operating system installed on it.
  • VolumeName - the actual name of the volume, how it should appear under the icon. If there is a space in the name, you must put the full name in quotes ("name") or put a slash before the (name Drive\) space. In our example, we made these, naming our volume "Macintosh HD".
  • size : this is the size of the volume. In our example, we had a 1.1 TB drive. We used '1100g' to describe what 1100 GB (1.1 TB to base 10). Otherwise, we could have also used 1.1 T or even 100% as a size.
  • 11. go to diskutil to verify that you can see this new partition on the list.
  • 12. test by erasing all the data from it.
  • 13. then you can go ahead to start on the USB drive to install OSX and install a new copy of Mac OS x on it.
  • 14. This will allow you to keep the recovery disk feature.
  • X. how Prime to recover partition
  • Press and hold the command and button R set immediately after hearing the bells to boot.
  • Only release it 2 seconds after you see the Apple logo on the screen and the progress bar for the start. This will start the partition of hard drive recovery.
  • Y. how-to boot OSX install USB
  • Press and hold the command and the optionkey together immediately after hearing the ringing of boot.
  • Only release it 2 seconds after you see the Apple logo on the screen and it will give you a list of startup disk choice, choose the OSX install USB to boot from.
  • Toshiba M100 - how to optimize performance?

    I move my Toshiba M100 of XP to Windows 7 after installing 2 GB of ram.

    How to improve performance of my system?

    Hi mate,

    What Toshiba M100 you have? Is it Portege M100, Satellite M100 or what else?

    To improve the performance of Windows, you must defragment the HARD disk, disable all services that you need and turn off all them start up programs you don't need.

    If you ask Google for some tips how to optimize, there is enough! ;)

Maybe you are looking for

  • http authentication fails on all sites, don't ask for user/pass

    Hello After an update of apt - get, sites that use HTTP authentication do not ask for credentials and go directly to HTTP:401. It only affects this browser, others have no problems. I've also updated a FF in Windows, no problem there after the update

  • Qosmio F20 - integrated HARD disk error

    My F29 took a very heavy today around the area of the HARD drive on the right forward, while my children played. Basically, I'm saying that when it hit it eclipsed the panal speaker close to the screen. For some time he continued to work but about 10

  • HP mini 110: HP Mini 110

    I am trying to get on this computer hp mini 110 and it goes straight to enter the current password, I never put a password here! Help CNU9481GQM Thank you

  • Suspicious stops on my Satellite A100-881

    Hi, I bought a new Satellite A100 881 since autumn, and fine... I play my favorite games (World of warcraft, europa universalis 3) very well... but I lived 3 stops, first in January, last a few minutes ago. I thought it was overheating, classic behav

  • File system is missing on my Satellite A60

    My Toshiba A6O is buggered! It keeps saying that the Windows SYSTEM file is missing, so I reformat and it still say that? s missing! What can I do, because he wonâ? t actually start up correctly! The closest I get is a screen saying about starting in