Great Ideas. Always Flowing.

We are not happy until you are happy. Client satisfaction guaranteed. Whatever your needs and requirements, we have the skills and resources for the job!

Quick login...


Or... now make it easy with Facebook Integration
Connect via Facebook



Top Sellers

Frustrated over the lack of customization for your user's registration fields? Dynamically setup your DNN Portal with custom registration fields, layout, questions, and other core integration options......

Ultra Video Gallery is a brother product of Ultra Media Gallery, UVG allows you to upload videos in various format and automatically encode them to flv or H264 format, you also can add videos from internet or record live videos from your webcam.

Build high performance, completely customizable data-entry forms and views driven by your DNN and external databases. New built-in tools make it a snap to quickly create data entry forms, data views, and even database tables. Plus, add your own HTML, CSS, Javascript, SQL commands, stored procedures,

The most advanced DotNetNuke shopping cart on the planet. Easy to use e-Commerce, Secure Shopping Cart Software and SEO friendly. B2C / B2B Ecommerce Sites.

One stop solution for events calendar and events registration! FREE DOWNLOAD is available now!

calculating a total from checkbox values
Last Post 05-06-2010 06:54 AM by David To. 20 Replies.
AddThis - Bookmarking and Sharing Button Printer Friendly
  •  
  •  
  •  
  •  
  •  
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
brad oylerUser is Offline
skipping stones
skipping stones
Posts:8
Avatar

--
05-16-2007 10:52 AM

    I am trying to create a basic order form, that lets the user to check checkboxes for different fees. Like Basic ($10) Advanced ($20), etc. Is there a way to have the form or email form created a total of all those values??

    brad oylerUser is Offline
    skipping stones
    skipping stones
    Posts:8
    Avatar

    --
    02-23-2008 08:19 AM

    I am still trying to do this now with 2.5, but using comboboxes. Is this at all possible? I saw that some type of field calc was possible, but not sure how to use in an email event.

    Chad NashUser is Offline
    Posts:5260
    Avatar

    --
    02-25-2008 02:23 PM

    Brad,

     

    Hi. Yes you should be able to do this now with client side events. You might download the IPORTABLE file found on this Dynamic Forms Demonstration.

     

    I also just setup a demonstration on Beta Springs to help another user wanting to calculate the field into a textbox or hidden field type so that they could then use SQL.

     

     

    -Chad

     

    brad oylerUser is Offline
    skipping stones
    skipping stones
    Posts:8
    Avatar

    --
    02-25-2008 07:54 PM

    OK, I now see the relation between client-side events, Javascript file, and the "CalculateCheckBoxListValues" function. However, what would a similar Javascript function look like for drop-down list values?

    Thanks.

    brad oylerUser is Offline
    skipping stones
    skipping stones
    Posts:8
    Avatar

    --
    02-26-2008 04:54 PM

    My problematic form is here: http://www.w3portals.com/testform/t...fault.aspx

    and now my problem is adding the two values fee1 + fee2.

    Any idea what I'm doing wrong? I'm using the client side event: $(total) = $(fee1)+ $(fee2)

    Thanks.

    Chad NashUser is Offline
    Posts:5260
    Avatar

    --
    02-26-2008 07:03 PM

    Brad,

     

    Hi. Great example of a useable feature, we probably need to add something into the default javascript file to calculate fields such as this.

     

    In this example you are concatenating javascript which would be useful if they were characters (such as concatenating first and last name to be display name or something).

     

    I did a quick search on some Javascript examples for calculating fields and saw the parseInt(field) function call. I setup a test javascript calculation field creating total demonstration form just like yours and it appears to be working.

     

    So...

     

    $(total) = parseInt($(fee1)) + parseInt($(fee2))

     

    -Chad

     

    Stephen BeasleyUser is Offline
    wading in the water
    wading in the water
    Posts:16
    Avatar

    --
    02-29-2008 05:25 AM

    This might not be the right place to ask, if you would like me to start another post, I certainly wiil.

    In calculating a total from check box values exactly like the sample, if the total value ends in a zero, it leaves the "0" out.  For example - total is........... $35.9  -  Instead of $35.90.  I just thought of it, so I did not test what would happen if the cost is $35.00, but my guess is it would drop the two zeros.  What would be the script for showing the zero/zeros?

    Michael WinbladUser is Offline
    wading in the water
    wading in the water
    Posts:26
    Avatar

    --
    02-29-2008 06:50 AM

    Thank you for letting me know about the parseInt. I should have looked at this forum entry sooner. This solved my problem but I thought I would give people a heads up. If you are adding an amount to an existing field, you want to make sure all fields have values. You can do this by defaulting the values to 0.00 when you define the form. Otherwise, you may receive an error when you perform the calculation.

     

    As soon as I can find a java language reference on-line, I will offer something on the precision problem posed before (nice alliteration, huh). I am sure use of substring and length functions to find the position of the current decimal in the answer and then concatenate the needed number of digits and decimal depending on how close the decimal is to the end of the string.

    Stephen BeasleyUser is Offline
    wading in the water
    wading in the water
    Posts:16
    Avatar

    --
    03-08-2008 10:55 AM

    Hi,

    I have found a very easy solution (I can get it to work in a simple HTML) but I do not know how to implement in custom javascript:

    The code that works is:

    var field = 35.90;
    var total = '$' + field.toFixed(2);
    or without calling variables
    total = '$' + total.toFixed(2);

    So can you create a function in custom javascript to just say $(the inputvalue) = $(the inputvalue).toFixed(2);  Obviously this does not work, but I can't figue out what the "name" of the input field of the question is?? Or just a script to say whatever the end result or value of the textbox input, convert it to xxxxxxx.toFixed(2);  Anybody have any ideas to try??  I like the calculatecheckbox and the way it works, but when yo have 99 options, well, it doesn't look good.  I can't even believe when they were creating JS nobody ever thought of currency, like currency($(shortname).  There is sine, cosine, theories i've never heard of etc...But nothing for currency???

    Anthony SuttonUser is Offline
    Posts:14
    Avatar

    --
    05-05-2008 10:55 PM
    Posted By Chad on 02/26/2008 9:03 PM

    Brad,

     

    Hi. Great example of a useable feature, we probably need to add something into the default javascript file to calculate fields such as this.

     

    In this example you are concatenating javascript which would be useful if they were characters (such as concatenating first and last name to be display name or something).

     

    I did a quick search on some Javascript examples for calculating fields and saw the parseInt(field) function call. I setup a test javascript calculation field creating total demonstration form just like yours and it appears to be working.

     

    So...

     

    $(total) = parseInt($(fee1)) + parseInt($(fee2))

     

    -Chad

     



    Chad, I am getting a Error on this form "total is undefined", I have you form exactly and it is on your beta site I get that error. It must be some thing on my server , any suggestion on how i could go about fixing this?? Thx

    Chad NashUser is Offline
    Posts:5260
    Avatar

    --
    05-06-2008 07:34 AM
    You might set the form up exactly as you have it on your server but on beta springs (from scratch). From there we can determine what the difference is between your form and the form with the link above. There shouldn't be anything specifically different on your server for this. Also, keep in mind that '$(total)' is actually the short field name for the 3rd field. What is the short field name for your 3rd field set to?

    Anthony SuttonUser is Offline
    Posts:14
    Avatar

    --
    05-06-2008 08:21 AM

    Chad thanks for the response, I spent a few hours on this yesterday, and after no success getting it to work I exported the content from beta springs because I knew that worked. I imported it to my site and wham, same error. so building from scratch on beta springs will work but will not solve my issue. I can setup an admin account for you on my site so you can see what I am talking about. Thx.

    Chad NashUser is Offline
    Posts:5260
    Avatar

    --
    05-06-2008 10:46 AM
    Hi. Yes, please do (please email us or open support ticket to give this info).

    Then we can follow up with this post in case other users run into this. As far as I know the only requirement after export/import is to go into the module configuration and save the javascript file at least one time. This is because there is a setting that displays if it has already saved the javascript file the first time you go into the module configuration, well when you export/import all of the settings this tells the module that you already have so it doesn't do this for you. That should be the only requirement though so please open a support ticket and we can follow up here when we find out what was causing the problem on your end.

    Chad NashUser is Offline
    Posts:5260
    Avatar

    --
    05-07-2008 09:09 AM
    Hi guys... I wanted to follow up on this thread as we reviewed this yesterday. It appears (for performance reasons) that it only parses tokens for short field names within client side events... if those tokens have a client side event attached to it. We will review this in the future but basically what was happening here is that the client side javascript was using $(total) within it, however the total field wasn't using any client side event. So we added the same function call (to total two fields) into the client side event for the total field and this fixed it up.


    Another note: If you are signed in as the admin, adding ?Debug=True to the querystring will spit out the exact client side event that is being rendered. This allows you to see if there are anything within the event that doesn't look right.


    Thanks,

    Chad
    HeatherUser is Offline
    wading in the water
    wading in the water
    Posts:23
    Avatar

    --
    10-10-2008 08:58 AM
    Just a follow up note. I noticed in the javascript for 2.7 that you had added the formatCurrency tag to solve the "decimal" issue. Works great! Thanks.
    Chad NashUser is Offline
    Posts:5260
    Avatar

    --
    10-10-2008 09:01 AM
    Yes.. Also, we will continue to add to the 'default JavaScript file' but also keep in mind even in running earlier versions of Dynamic Forms that you can always add, create, or save the JavaScript. So if the JavaScript you are wanting to use is on Beta Springs and not yours you can always copy/paste and click 'Save JavaScript File' on your module instance.


    -Chad
    Andres OdioUser is Offline
    new to the springs
    new to the springs
    Posts:3
    Avatar

    --
    12-28-2008 08:20 PM
    Hi,

    I tried importing the .xml file from Demonstration 6 (http://www.datasprings.com/Products...ult.aspx), such that my module looks exactly the same.

    However, when I click on one of the Products checkboxes, the Total does not get updated and I get a Java error. The error that appears is: "Object expected".

    Does anyone know what could be wrong?

    Thanks
    CandaceUser is Offline
    river guide
    river guide
    Posts:2431
    Avatar

    --
    12-29-2008 08:08 AM
    Hi Andres,

    Chad's comments above on 10/10/08 might help you. Have you tried this yet under Module Configuration?

    Candace
    KellyoUser is Offline
    river guide
    river guide
    Posts:113
    Avatar

    --
    05-05-2010 03:47 PM

    I have a total that is calculated from combo boxes .. it worked perfectly .. then I exported the module as template and imported it into a new page ( a second form , and now formatCurrency no longer works. It still works fine on the original form .. but on the copied form it does not .. same code. The total updates correctly in a hidden "Total Field" and if I remove the formatCurrency() from the displayed total HTML field it does works .. but when I add formatCurrency() back in I get an object expected error. ??

    I've tried renaming fields and innerHTML id etc .. but no luck.

    Kelly 

    KellyoUser is Offline
    river guide
    river guide
    Posts:113
    Avatar

    --
    05-05-2010 03:58 PM

    Hi Chad/Candace, regarding previous post .. I copied the javascript file from the module config in the first page form .. and pasted it into the second page form. This resolved the issue.

     

    So just a note that perhaps .. something in the formatCurrency js gets messed up on export/import. Version 3.3.4 on DNN 5.4.1

    Kelly

    David ToUser is Offline
    river guide
    river guide
    Posts:2719
    Avatar

    --
    05-06-2010 06:54 AM
    HI Kelly, the Javascript file doesn't get retained on export / import of XML so any functions that get modified or added in one form will not retain on export / import into another form under the Javascript File ar ea. -- David
    You are not authorized to post a reply.


     
     

    Join our mailing list...

    Get current news and events the easy way
    Subscribe Me

    Recent Blogs...

     
    Copyright 2005 - 2011 by Data Springs, Inc.
     
  • film izle
  • 720 izle
  • film
  • sinema izle
  • film makinesi
  • T�rk�e dublaj film
  • film izle
  • film izle
  • baglan film izle
  • sinema izle
  • 1080 film izle
  • film mercegi