ClydeG
going with the flow Posts:61
|
01-11-2010 09:46 AM |
|
id="Monthly">Your total comes to: $0.00 |
|
|
|
|
David To
river guide Posts:2719
|
01-12-2010 06:42 AM |
|
HI, have you gotten this to work yet? Again, you need to use the "document.getElementById" on all the fields that requires a sum / recalculation. If you are still struggling with this, please feel free to export your content to a page on www.betasprings.com(username: host, password: dnnhost) and send us the URL / TABID and I will gladly see if I can total it for you. -- David |
|
|
|
|
ClydeG
going with the flow Posts:61
|
01-12-2010 10:18 AM |
|
I added a page on betasprings.com called clydeg1. I added 2 modules to the page. The first one works on my site in IE but the second doesnt. Oddly enough, neither works there... Thanks for your help, Clyde |
|
|
|
|
David To
river guide Posts:2719
|
01-13-2010 07:44 AM |
|
Can you post the TabID / URL? Having a "page name" doesn't help since there are hundreds of pages on the site and would be very difficult to locate. -- David |
|
|
|
|
ClydeG
going with the flow Posts:61
|
|
David To
river guide Posts:2719
|
01-13-2010 09:43 AM |
|
DONE. I fixed the top module. You need to change client side script to this: document.getElementById('Monthly').innerHTML = 'Your total comes to: ' + (parseInt($(Amount)) - (parseInt($(Minus)))) / (parseInt($(Months))); + ''; -- David |
|
|
|
|
ClydeG
going with the flow Posts:61
|
01-13-2010 10:00 AM |
|
Thank you very much. That fixed it. Will use the code to fix my large form...thanks again! |
|
|
|
|
ClydeG
going with the flow Posts:61
|
01-15-2010 07:58 AM |
|
I have one more question on this form. I need to have the calculation show in currency value. To 2 decimal places. What change will I need for that?
Thanks |
|
|
|
|
ClydeG
going with the flow Posts:61
|
02-10-2010 01:03 PM |
|
Is there a way to make the total show as currency? |
|
|
|
|
David To
river guide Posts:2719
|
02-10-2010 01:32 PM |
|
Add in something like this to your javascript: var total; total = (parseInt($(Amount)) - (parseInt($(Minus)))) / (parseInt($(Months))); ocument.getElementById('Monthly').innerHTML = 'Your total comes to: ' formatCurrency(total) + ''; -- David |
|
|
|
|
ClydeG
going with the flow Posts:61
|
02-15-2010 06:27 AM |
|
I have tried this several different ways and it doesnt work. I get an error : expected. I am not sure where it is missing. This is the latest variation: :var total; $(Total) = (parseInt($(Amount)) - (parseInt($(Minus)))) / (parseInt($(Months))); document.getElementById('Monthly').innerHTML = 'Your Monthly Payments will be: ' formatCurrency$(total); + ''; |
|
|
|
|
David To
river guide Posts:2719
|
02-15-2010 06:33 AM |
|
var total;
$(total) = (parseInt($(Amount)) - (parseInt($(Minus)))) / (parseInt($(Months)));
document.getElementById('Monthly').innerHTML = 'Your Monthly Payments will be: ' + formatCurrency($(total));
Try the above (NOTE: you had a ":" in front of the "var tota" which is incorrect. Also, javascript is case sensitive so the 2nd line should be $(total) and NOT $(Total) .
I would also suggest using Mozilla Firefox with Firebug enabled for debugging javascript.
-- David |
|
|
|
|
ClydeG
going with the flow Posts:61
|
02-15-2010 06:52 AM |
|
Stil not working for some reason. Here is what is working: document.getElementById('Monthly').innerHTML = 'Your Monthly Payments will be: ' + '$' + (parseInt($(TotContractAmt)) - (parseInt($(Minus)))) / (parseInt($(TotNbrPymts))); + ''; This is what I tried: var total; $(total) = (parseInt($(TotContractAmt)) - (parseInt($(minus)))) / (parseInt($(TotNbrPymts))); document.getElementById('Monthly').innerHTML = 'Your Monthly Payments will be: ' formatCurrency$(total); + ''; As you can see, some of the field names changed, but that is it. Any idea. The firebug isnt giving me any insight. |
|
|
|
|
David To
river guide Posts:2719
|
02-15-2010 06:56 AM |
|
Hi, at this point, it's best for you to export your form to www.betasrpings.com (username: host, password: dnnhost) and state the URL/TABID here and I'll take a look at it either today or tomorrow morning. -- David |
|
|
|
|
ClydeG
going with the flow Posts:61
|
|
ClydeG
going with the flow Posts:61
|
02-16-2010 09:56 AM |
|
Hi David, were you able to find the page? Thanks, Clyde |
|
|
|
|
David To
river guide Posts:2719
|
02-16-2010 10:51 AM |
|
DONE. Please take a look at the updated javascript on those fields. -- David |
|
|
|
|
ClydeG
going with the flow Posts:61
|
02-16-2010 11:18 AM |
|
Thats it! Thanks a ton! |
|
|
|
|