Javascript only works for "easy" numbers (and multiplying error)

HIi Everyone,
I have a scripting problem.  I used javascript to do some division and subtraction, but it only works some of the time in the second half of my form.  What I mean is, if I'm using a nice even number like 100-the calculations are correct, but if I use 415.75, it calculates, but not correctly.  (I actually also have that problem with some multiplying also???)  It's very weird.  And it only seems to be this particular form.
I can e-mail the form if that will help.  I'd appreciated any help you can give me.
Thanks,
Valerie

Sure.  The form looks like this: (Field Names are in quotes.)
1. Total Amount of Third Party Recovery      "total third"
2. Accrued Compensation Lien                   "accrued"   (I clicked in calculations and just clicked "value is the sum of the following: and then clicked the field
     a. "indemnity benefits"                                             names of a and b.)
     b. "expenses of medical"
3. Expenses of Recovery                             "recovery expenses"
4. Balance of Recovery                              "balance"  (Its supposed to be #1minus #2)  I used this script:
                                                                 this.getField("balance").value = thisgetField("totalthird").value - this.getField("accrued").value;
HiddenLockedField "percent" (The content is set to 100.)
5. Lien Expenses Reimbursement Rate          "5"   (#2 divided by #1 * 100)   I used this script:
                                                                   event.value = ""
                                                                   var accrued = getField("accrued").value;
                                                                   var totalthird = getField("totalthird").value;
                                                                   var percent = getField("percent").value;
                                                                   if(totalthird!null && total third!=0)
                                                                   {event.value = accrued / totalthird * percent;}
6. Expenses Attributable to Lien                    "attribute"    (Supposed to be #3 times #5.)  I went to calculations, anc clicked on, "value is the product
                                                                     of the following" and checked "recovery expenses" and "5".
7. Net Lien                                                   "netlien"   (Supposed to be #2-#6) I used this script:
                                                                   this.getField("netlien").value = this.getField("accrued").value - this.getField("attribute").value;
8. Reimbursement Rate of Future Lia.             "rate" (Supposed to be #3 divided by #1 * 100.) I used this script:
                                                                     event.value = "";
                                                                     var recoveryexpenses = getField("recoveryexpenses").value;
                                                                     var totalthird = getField("totalthird").value;
                                                                     var percent = getField("percent").value;
                                                                     if (totalthird!=null && totalthird!=0)   
                                                                     {event.value = (recoveryexpenses / totalthird) * perent;}           

Similar Messages

  • CFCHART only works for pie, invalid attribute: autoAdjust Error for all other types

    CFCHART only works for pie, invalid attribute: autoAdjust
    Error for all other types.
    Im just trying to render a simple bar chart, and it works on
    the developer server, but not in production.
    Any tips?
    Dave

    It's 7.0.2
    But I have not tried this yet...
    ColdFusion MX 7.0.2 Cumulative Hot Fix 2
    http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=kb400996
    I'm worried that If I apply that hotfix, something else will
    break :(
    ANd I wont be able to un=do it, and I'm not able to
    re-install CF if it all goes tits up.

  • I can only make outgoing calls. My home button is only working for voice control and won't take me back to menu. I am only in the calling screen and can't even shut off. What do I do?

    I am freaking out! I am a college student and owner of my Iphone 3Gs. I just got it this past August and I don't understand what is wrong. I did not drop it or come into contact with any water or disabling substance. I am literally stuck on the calling page with favorites, recents, contacts, keypad and voicemail. When I push my Home button I am not brought back to my menu. When I hold it down voice control is enabled but I still can't get to my menu. Then when I try to hold the sleep button to shut off nothing happens. What's wrong with my phone? I can't even go into contacts and hit text message nothing happens. Also, when I get a message in nothing happens when I push view. Please help me.

    Try a reset by pressing the home and sleep buttons until you see the Apple logo, ignoring the slider. Takes about 5-15 secs of button holding and you won't lose any data or settings.

  • My applications always quit...iChat only works for 4 minutes at a time HELP

    ok so i bought leopard today
    i installed it but i skipped that step when leopard checks the volume of your comp or whateever (not sure if that will affect what im about to say)
    now i have leopard...i love it but my applications just KEEP quitting out and my iChat only works for 4 minutes and then my friends stop recieving my messages
    should i uninstall and re install?? how would i go about doing that??
    anything just please help

    One possibility is that your hard drive is failing. If you don't have backups of any data you don't want to lose, that needs to be your number one priority. Get that data backed up. Once you have done that, you can start exploring options.
    Open Disk Utility, select your hard drive and take a look at the SMART status:
    If it says anything other than Verified, the drive is definitely failing. If it says Verified, all that means is that it isn't failing in a way that the drive can detect.

  • I HAVE MAC BOOK PRO 15" AND MY BATERY ONLY WORK FOR 1HOUR AND 30 MINUTES ..WHAT HAPPEN?

    I HAVE A MAC BOOK PRO 15" SINCE 2011 AND MY BATERY ONLY WORK FOR 1HOUR AND 30 MINUTES ..WHAT HAPPEN?

    Look inside your System Profiler & copy/paste your battery health info.  Do not post any serial numbers.
    BTW:  Typing in caps is considered shouting in cyber space.  We can all hear ya!  Besides, it is very hard to read. 

  • Safari and firefox stop working after a few minutes of browsing, regardless of what site I'm on. I have to restart my computer to get internet access again but it only works for a few more minutes, then I have to restart again. Please help!

    Safari and firefox stop working after a few minutes of browsing, regardless of what site I'm on. I have to restart my computer to get internet access again but it only works for a few more minutes, then I have to restart again. I don't get a spinning ball, it just stops working at whatever page it's on. I can close the program just fine but when I re-open it, either safari or firefox, it freezes trying to load the hompage. This started a few days ago after trying to stream a movie on my computer. I'm on a Mac Air OS X Version 10.6.8 and have downloaded all updates. When I go into finder, it says I have over 80 gigs available. Is there some other memory cache that I need to check? Thanks so much for your help.

    ejwoodall wrote:
    It's not a router problem as I explained in my post. If it was a router problem then I wouldn't have the problem everywhere I go. It is an issue with the software.
    Then I guess the millions of people running 10.5.7 with no issues are just hallucinating that their machines are working fine?
    I'm not trying to belittle your issues; you're certainly having them and I know first hand how annoying an intermittent AirPort issue can be. (In fact, mine was due to an AirPort driver bug that no one else seemed to suffer from.)
    The single best diagnostic you could do is take your system running 10.5.7 to an Apple Store, and try using their in-store network.
    If your machine performs flawlessly, it may be a router issue.
    If your machine has connectivity issues there, it may be a hardware problem with your machine.
    There have been numerous people in multiple threads over the years who swore that an update was buggy because things used to work, but returned later to sheepishly admit that they took their machine in, a problem was found and fixed, and now their Mac works flawlessly with the newer software.
    But simply reinstalling 10.5.5 in no way means the explanation of how firmware bugs may be at play here is incorrect.
    In the context of that explanation, all you've done is possibly reinstall software that asks to add "2 + 3."

  • My ringer is no longer working for text and email notifications. Only working for phone calls. I have gone through all the settings to see where something is off. Not finding anything. I have tried changing the tone and it just vibrates on everything.

    My ringer is no longer working for text and email notifications. Only working for phone calls. I have gone through all the settings to see where something is off. Not finding anything. I have tried changing the tone and it just vibrates on everything.

    Ok so I happened to figure it out while on the phone to apple support. Even though the guy was very nice, I think I knew more than him! He was explaining very basic resolution principles I played about. I had the second option in displays resolution. All I did was unplug the HDMI cable, click on 'best for display' then plugged the HDMI in and my resolution on the normal monitor changed to the normal blue, then went black momentarily and then changed to a strange resolution but another window appeared that said SONY BRAVIA HDMI at the top! Hey presto! Don't know why it didn't do it yesterday - I probably left the HDMI cable in or something! Oh well. Problem solved!

  • With my i phone 4 , the Push notifications doesn't work for apps like (fb viber , whatsapp etc ) it only works for the official apps like message  even when im using the phone, has  this probleme with the iOs 6.0.1 and also with the iOs 6.1

    With my i phone 4 , the Push notifications doesn't work for apps like (fb viber , whatsapp etc ) it only works for the official apps like message  even when im using the phone, has  this probleme with the iOs 6.0.1 and also with the iOs 6.1

    This isn't an issue. Notice the screen prior to the one that shows usage has an iCloud section and a Manage Storage button. For this button to activate ios needs to download a few kb from icloud. Switching back to this screen forces ios to download those few kb.

  • Hello all,  I bought an iPhone 5 in the US and brought it back to Brasil. Now I'm trying to use Siri, but once I press the "home" button "voice control" appears and it only works for me to call my contacts. The manual guide tells me to go to Settings Gene

    Hello all,
    I bought an iPhone 5 in the US and brought it back to Brasil. Now I'm trying to use Siri, but once I press the "home" button "voice control" appears and it only works for me to call my contacts. The manual guide tells me to go to Settings>General>Siri. At the General menu "Siri" doesn't appear. What should I do to set Siri up if it doesn't appear at settings>general?
    Thank you,
    Melanie.

    Go to Settings>General>Restrictions and make sure Siri is set to On.

  • Caching service only works for OS X updates and not for Apps

    Hello,
    It seems that my OS X Server Caching service only works for Apple OS X Software Updates (in Mac App Store updates, when the icon of Mountain Lion appears). I see it in my logs in verbose mode when I download an Apple OS X Software Updates and not when I download an app in Mac Appstore.
    So I'm sure my Caching service works but not for all downloads.
    Why ? What's wrong with my server ?
    I read in some blogs that Caching Server can work for iOS devices appstore too. I try to download some apps with my iphone but nothing happens in logs ...
    Can somebody help me about the Caching Server ?
    Thank you.

    I am with chugues http://www.apple.com/ios/business/
    Caching Server 2 supports iOS 7.
    By caching purchased content and software updates on a local Mac running OS X Mavericks Server, Caching Server 2 speeds up the download and delivery of content through the App Store, Mac App Store, iTunes Store and iBookstore. Your users get faster downloads of content and updates to their iOS devices directly over your corporate network.
    Shows iOS updates and et al. Why is this feature not on yet?

  • HT1555 i just got a new apple tv but for some reason the remote only worked for about a min. and than it wount work at all. i tried to pair and unpair but nathing works but when i press a button the light on the apple tv turns off. what should i do?

    i just got a new apple tv but for some reason the remote only worked for about a min. and than it wount work at all. i tried to pair and unpair but nathing works but when i press a button the light on the apple tv turns off. what should i do?

    Have you held the menu and left arrow together for 6 secs ?  (I think you have from what you say).
    Also try unpowering and restarting AppleTV.
    AC

  • HT1349 The nice man Joseph Shen helped me with my google problem on my iPhone and worked for 2 days and now not working again please help me solve this problem were I can retrieve my messages on the I phone when I am not at home  on my wi Fi is the only t

    The nice man Joseph Shen helped me with my google problem on my iPhone and worked for 2 days and now not working again please help me solve this problem were I can retrieve my messages on the I phone when I am not at home  on my wi Fi is the only time it works correct. Bill. [email protected]  708 752  3667 

    http://lifehacker.com/5852948/what-to-do-if-youve-forgotten-your-iphones-passcod e

  • My iPod shuffle, which I prchased in 2009 only worked for a short time so I put it back in the box and just recently took it out. I will not charge and the power light does not come on. It was faulty from the start and thought I was out the money I paid.

    My iPod shuffle only worked for a short time. It will not charge  and the power light does not come on. Bought it in 2009. Put it back in the box and in my desk. Recently tried to get it to work again but no luck. Anyone else have this problem? Very disappointed with the product although my wifes work perfectly.

    Can't say I haven't done the same kind of thing...keep finding things I had every intention of...
    If you have the chance stop by an Apple Retail store and talk to them about it...they often work deals for replacement of out of warranty non-working items for prices around half price.  Won't hurt to stop by and see what they will do for you.

  • I have the portable BOSE sound dock and after updating my ipod to ios7 the remote control of the dock only works for the volume but doesnt work for skipping songs....Is there a solution to this?

    I have the portable BOSE sound dock and after updating my ipod to ios7 the remote control of the dock only works for the volume but doesnt work for skipping songs....Is there a solution to this?

    Have you went to Bose"s support site?
    Sometimes this works
    - Reset the iOS device. Nothing will be lost
    Reset iOS device: Hold down the On/Off button and the Home button at the same time for at
    least ten seconds, until the Apple logo appears.
    - Reset all settings      
    Go to Settings > General > Reset and tap Reset All Settings.
    All your preferences and settings are reset. Information (such as contacts and calendars) and media (such as songs and videos) aren’t affected.
    - Restore from backup. See:                                 
    iOS: How to back up                                                                
    - Restore to factory settings/new iOS device.             
    However, sometimes an iOS update breaks compatibility and you will have to wait for an firmware update for the Bose or an iOS update.

  • Hide "more" button in a list view, only works for first item in the list

    I have the following code in a list view that outputs several dozen items in a web app.  The code only works for the first item, how can I make it loop through and execute the test for each item in the list view?  The {tag_hide more button} is a checkmark field that yields a numeric 1" if checked otherwise yields a numeric "0".
    <div id="more-option">
            <p class="right"><a href="{tag_itemurl_nolink}" class="btn btn-small btn-very-subtle">More &rarr;</a></p>
          </div>
          <div class="more-selection" style="display: none;">{tag_hide more button}</div>
          <script>
    if ($(".more-selection").text() == "1") {
        $("#more-option").hide();
    </script>

    What's the URL for the site where you are using this?  Offhand, it looks like it should work with your first example so you are either placing the script before those elements are loaded or you might try wrapping your current javascript inside the:
    $(document).ready(function() {
    --- your existing javascript here
    This make sure the code runs once all the html is loaded on the page.  Without seeing a URL and debugging with the js console in Chrome I can't give you a solid answer.
    But, I do know that you can probably do this with a lot less markup.  Once we figure out what the actual problem is I have a better solution mocked up for you on jsfiddle.
    When looking at my HTML code on jsfiddle, please realize I setup some dummy HTML and removed your tags and added actual values which would be output by your tags.  The main thing I did was remove the whole div.more-selection and instead, added a "data-is-selected" attribute on your div.more-option element.  Then, in my javascript for each div.my-option element on the page, we loop through them, find the value of that data attribute and hide that div if it's less than 1 (or 0).
    Here's the fiddle for you to look at:  http://jsfiddle.net/thetrickster/Mfmdu/
    You'll see in the end result that only two divs show up, both of those divs have data-is-selected="1".
    You can try pasting the javascript code near the closing </body> tag on your page and make sure to wrap my js inside a <script> tag, obviously.  My way is neater on the markup side.  If you can't get it to work it's likely a jquery conflict issue.  My version is using the $(document).ready() method to make sure all the code is loaded before it runs.
    Best,
    Chris

Maybe you are looking for