How do you calculate multiple fields in a Form?

Hi,
I have a spreadsheet with several headings and several fields as illustrated below, and description of each field and calculation required is listed below.
Rate Per Day
Days
Course
Attending
Total
$1,000
2
Course A
Yes
$2,000
$2,000
1
Course B
Yes
$2,000
$5,000
5
Course C
No
$2,000
2
Course D
Yes
$4,000
Total:
$8,000
Rate per day:  Field value is inputted by us.
Days:  Field value is inputted by us.
Course:  Field value is inputted by us.
Attending:  Is actually a check-box that the client ticks.
Course Total:  This should be the calculation of RATE PER DAY * DAYS IF ATTENDING BOX IS CHECKED
Total:  Sum of above COURSE TOTAL FIELDS
We currently do this in EXCEL 2007, however we looking at converting it to a PDF Form for distribution to our clients to we can track responses, etc.
My question is really ery simple ... how do I create the above calculations in a form that I want to distribute??  This possible?? If so how (please bear in mind I'm not a developer

In re-reading your question, I realized you're using a check box. In that case, you will need to create a custom calculation script using JavaScript.
Something like:
// This is a custom calculation script
(function () {
    // Get the value of the check box
    var v1 = getField("Attending1").value;
    if (v1 !== "Off") {
        var v2 = +getField("Rate1").value;
        var v3 = +getField("Days1").value;
        // Sum the two field values and set the value of this field to the result
        event.value = v2 + v3;
    } else {
        // Blank field if checkbox is unchecked
        event.value = "";
You'd replace the field names I used with the field names you're using.
This leaves out checking to see if the corresponding Couse field is filled-in, and you'll have to use a custom Format script if you want the type of formatting you show.

Similar Messages

  • How do you calculate a field

    Hi all,
    I would really appreciate some help as I do not know programing, java script or other programming languages.  I need to have a field calculate for me.
    The form has date of birth. Then I need the next field, (a text field) calculate the age on the previous field of the Date of Birth.  Does anyone have an idea how to do that?  I have gone through the help guide, but it assume you know the langauage to put in.
    thanks in advance.

    Janet, I've fixed the form and attached the updated version.  There were a couple of things that I changed:
    1. The form was saved as a static .pdf form.  This means that it's for display only; you can't run any scripts and change things programatically.  I changed it to be a dynamic form, which allows scripts to run when the user is entering data.  To do this I selected Save As from the file menu and then selected Save as type: Adobe Dynamic XML Form (*.pdf).
    2. Since the form was saved as static it stripped out the scripts.  I re-pasted the script that I gave you back into the calculate event for the Age field.
    I also changed the Language dropdown on the upper right side of the script window to Javascript, since that's the language that I used.
    3. The name of your DOB field is DateTimeField1.  You can see this by either looking at the Hierarchy window or by looking at the Field tab of the Object window.  In the future you should change the names of the fields from their default to something more descriptive.  For now it's fine.  I then replaced my references to "DOB" in my script with "DateTimeField1.
    4. Make sure that the preview type is set to dynamic.  Go to the File menu in designer and select the Form Properties item.  Click on the Preview tab and choose "Preview Type": Interactive Form and "Preview Adobe XML Form as": Dynamic XML form.
    The above changes made it work, but I changed one more thing:  The type of the DOB field is set to DateTime field, and when you use the pop-up calendar to select the date it gets saved in the data in a backward format (YYY-MM-DD).  This doesn't show up on the form since you have the display format set, but behind the scenes it messes up the date calculation in the script.  I set the edit pattern for the field to be either D/M/YYYY or D-M-YYYY to allow some flexibility when the user enters the date, and to force it to save in the proper format for the script.
    Oh, forgot to mention that "new Date()" gets the current date from the system, so you don't need a field on your form for it.  Green is a comment, not part of the script but just to document what's happening in the script.  Blue means reserved script instruction, black is everything else.  Makes more sense to you if you're a programmer. The Livecycle editor automatically colors the text to make it easier to read, we just type it in.
    Give this a try and let me know if you have more issues.
    Kevin

  • How do you calculate a date on a form?

    I am working on a form for our customers and our staff to use and I needfor it to calculate a date from another date. We are currently using an Excel spreadsheet that is working very well, but we are starting to run into customers who do not have access to Excel. Having the form in Adobe would give us more flexibility.
    Here is an example of exactly what I need:
    Last Read Date: 01/01/00
    Approximate Due Date_1: 01/26/00  (this is the Last Read Date + 26 days)
    Approximate Due Date_2: 02/26/00  (this is the Last Read Date + 56 days)
    Approximate Due Date_3: 03/26/00  (this is the Last Read Date + 85 days)
    Thank you

    Check out this previous topic: http://forums.adobe.com/thread/836872

  • Can you calculate multiple text boxes to achieve a total value?  If so how is that done?  I am trying to create a order form where multiple items can be purchased but i would like the values of each item to calculate so I can achieve a total value.

    Can you calculate multiple text boxes to achieve a total value?  If so how is that done?  I am trying to create a order form where multiple items can be purchased but i would like the values of each item to calculate so I can achieve a total value.

    Hi sashby51,
    I've moved your discussion to the PDF Forms forum--the folks who visit this forum regularly should be able to point you in the right direction.
    Best,
    Sara

  • How do you add multiple iTunes to Keynote

    How do you add multiple songs from the iTunes to your Keynote presentation?

    Jer&Renee,
    welcome to Apple Discussions.
    It depends where you want them in your presentation.
    Open the Media inspector and choose a playlist. In the list of entries, mark those you want to add to Keynote (use command-click to mark multiple titles not in one block).
    Then drag the marked titles either on a slide or on the small Audio field (looks like a frame) in Document inspector. When you then hover the cursor at the Audio "frame", you'll see the quick info "Multiple Files". You cannot change the order or remove one of the files, but only all of them.

  • How do you have multiple apple id's with one itunes

    how do you have multiple apple id's with one itunes

    I have multiple IDs and use the single computer sharing itunes. By 'sharing' I mean we open the pc, open itunes and log in with our individual ID as required.
    While Im logged in I plug in  my device. I transfer my purchases from my device as per the file menu (not the check for auto downloads). I move them as required to whichever playlist I like.
    Then when my son wants to use itunes or update his device, he logs in, plugs in his device, transfers purchases from his device, puts whatever music he wants into his playlist and/or drags direct to the device regardless of who purchased it and then syncs.
    Im not sure how it works associating the pc with only one ID or all that other business- I know I don't fiddle with any of that.

  • How do you highlight multiple documents rapidly, rather than having to click on the document and on "command" one at a time?

    How do you highlight multiple documents rapidly, rather than having to click on the document and on "command" one at a time? Right now, when I'm trying to highlight documents to export, I have to click on each document individually. Is there a way to highlight one document while scrolling down the list until all desired documents are highlighted? I would like to rapidly be able to do this to save time when I am exporting or saving multiple files from my documents to an external drive, CD-Rom or cloud storage.

    Click on the first item
    Hold the Shift key
    Click on the Last Item.
    All the items in between will be selected.

  • How do you delete multiple emails from your "inbox" w/o clicking on each one individually?

    How do you delete multiple inbox emails to trash w/o clicking on each one individually?

    Highlight one. Click edit. Click "mark all" at the bottom. Click trash.
    Barry

  • How do you select multiple files to drag

    How do you select multiple files to drag from one folder to another? Is there a command?

    Open the folder which has the contents you want to transfer.  Press COMMAND 'A' and then all of the data should be highlited in blue.  Drag it to the new folder.
    If only certain files are to be transferred, then you have to select them (COMMAND 'A')  individually and the drag them as a group to the new location.
    Ciao.

  • How do you select multiple messages/conversations on SMS/MMS to forward or save to memory card on Samsung Stratosphere?

    How do you select multiple messages/conversations on SMS/MMS to forward or save to memory card on Samsung Stratosphere? 
    My screen is cracked and I need to replace my phone and I don't see a way of selecting multiple messages or even conversations one at a time to forward them to email or to save them to a memory card.  I can delete thread but can't forward it or move it.  Is there a setting somewhere that will move the storage location for messages to the memory card instead of internal?
    If not, any suggestions on backup apps?  I have heard of Txtract to back up SMS and MMS messages, and Titanium Backup to back up everything (SMS, MMS, apps, app data...).  Anyone have any experience with those, or other suggestions?
    Thanks!
    Rich

    <Duplicate topic.  This thread will be locked.  Please see Help transferring data (SMS, MMS, Apps, App data) to new phone? for any replies.>

  • How do you select multiple songs in itunes to delete

    how do you select multiple songs to delete at once in itunes?

    Try highlighting the first one yhen command click on the others you wish to delete, when you have the ones selected hit delete.

  • How do you select multiple files at one time

    How do you select multiple files at one time

    Select one, and then either command-click another, or in list/column view, Shift-click the item at the other end of the range you want to select. Alternatively, click on a spot in the screen and drag the cursor until all the files are selected.
    (114308)

  • How do you use multiple outputs on a VSTi like Kontakt or Battery?

    how do you use multiple outputs on a VSTi like Kontakt or Battery with Logic Pro 7.1? I've heard someting about using AUX busses, but can anyone please provide an actual clear, step by step basic guide?
    I've had Logic 3 months now and just don't know how to do this yet, and have yet to actually find it in the manual!!
    thx

    http://www.sonikmatter.com/wiki/index.php/Tutorial:MultiChanAudioSetup

  • Solaris 11 IPS:  How do you post multiple versions of the same package?

    How do you post multiple versions of the same software package on a single IPS instance(port)? Oracle was able to do it here with versions 151 and 175 of S11:
    http://pkg.oracle.com/solaris/release/
    Unfortunately, based on my searches, no where in the documentation (http://www.oracle.com/technetwork/server-storage/solaris11/technologies/ips-323421.html) does it explain to the development community how this is done. The best I can do is create pkg repo instances on different ports to host each different software version.
    We are trying to deploy an IPS repository for our drivers and utilities that our customers can link to and pull updates from. We have been able to post a software package to the repository using the command:
    pkgsend publish -s http://localhost:1234 -d ./ Appv1.p5m
    This posts the package on the IPS repository instance at port 1234 on the server. However, we would like to post multiple versions of the package on the server at the same URL. Why the same URL? So that our customers and end-users need only point to a single URL to pull down our software rather than having to add a new URL to the publisher list each time we have an update. We want at least 5 of the previous software versions to be available on the server. Posting each version of the application or driver on a different IPS instance on a different port will require customers to add multiple URLs to their publisher list and they also will not be able to initiate remote scans for updates.
    Has anybody been able to do this? Is any documentation forthcoming?
    Edited by: user13489824 on Jun 25, 2012 10:17 AM

    dhduvall: Thanks for your response. Yes, one would think that as long as the version numbers are different, you should be able to accumulate multiple versions of a package in a repository. It looks like Oracle has done it in their S11 repository unfortunately, as far as I know, they have not shared the steps on how to do this. I would like to publish two versions of the same package. I.E. two different manifests with two different fmri.pkg version strings and two different binaries.
    If I publish one package after another like this:
    pkgsend publish -s http://localhost:1234 Appv1.p5m
    pkgsend publish -s http://localhost:1234 Appv2.p5m
    Then only the second package shows up in the repository, as if it over-wrote the first one.
    Running pkgsend with two manifest, like this:
    pkgsend publish -s http://localhost:1234 Appv1.p5m Appv2.p5m
    Will cause pkgsend to combine the packages and manifests as if they were a single package... not what I am trying to do.
    Both approaches are complete without errors but neither achieves what I am trying to do.
    alan.pae: Thank you. Unfortunately, the link didn't really help. I've read Oracle's white papers and IPS developer guide so I'm familiar with the topics covered.
    Lex: Yes, I know. I specified the versions in the pkg.fmri value string.

  • How do you post multiple personal domains to .Mac sub accounts?

    I was assured by .Mac tech support that .Mac will host a different personal domain on each of five accounts of a family pak. Now I discover that iWeb is a one-trick pony. I'm stunned that I can't create separate sites and upload them individually. I've never heard of an application that can only create one document!
    And I can't even find the data for that ONE document; ~/Library/Application/Domain.sites2 is only 20kb no matter how many photos you've added to the site.
    So I guess I have two questions: How do you post multiple domains to sub accounts?
    And, where's my data?

    The tilde (~/Library/etc.) indicates home folder; that is where I was looking. I did a Spotlite search and discovered that in attempting to backup my data, I'd moved it; Spotlite found it and it was all intact.
    Then I discovered I could duplicate Domain.sites2, change the names to Domain de.sites2, and Domain daru.sites2, open daru's site and delete de's, then open de's and delete daru's, and I had two separate sites that I presume I'll be able to upload separately. Once I get .Mac sub groups created...
    Seems like a stupid bit of programming; must have hired some windows guys to code it...
    Problem I'm having now is, .Mac won't let me set up a sub account in my wife's name because she already has a .Mac ID and a trial account because she joined a .Mac group. Awaiting a reply rom .Mac tech support.
    So my question isn't quite answered yet, but it does look like I can post several sites without having to set up separate user accounts. Seems like this could be explained in the help file in plain English...

Maybe you are looking for

  • Black screen after login, MacBook Pro - 15-inch, Mid 2010

    Processor  2.4 GHz Intel Core i5 Memory  4 GB 1067 MHz DDR3 Graphics  NVIDIA GeForce GT 330M 256 MB Serial Number  W80400EPAGX Software  OS X 10.8 (12A269) (matte screen) I have read all the other threads and my case is the sceen stays black I cannot

  • Webutil_105.zip problem

    Hi, I download the webutil_105.zip and when I try to extract, I got the error message fron winzip said that "Cannot open file: It does not appear to be a valid archive". Please help.

  • How do I print a topic using skin button?

    I have tried achieving this using the toolbarscripts01.js created by Willem Van Weeden on Peter Grainge's site. I've implemented .js in the skin for use with PDFs before, so I'm pretty sure I'm doing it right, but on click, nothing happens, when it s

  • How can you tell what pictures from iPhoto you already used in iMovie?

    how can you tell what pictures from iPhoto you already used in iMovie?

  • Disabling anonymous ftp access

    We have just completed a 9iFS install. The previous version of iFS was 1.1.6. We were having problems with anonymous logins (people were dumping garbage in our public folder) and we disabled anonymous FTP by changing the guest password (we also chang