After attempting to bribe people to do this for me, I actually made some progress on my own:
http://funkysoulrebels.com/calculator/
By god I am starting to actually understand this!
There...
Type: Posts; User: pimpmaster; Keyword(s):
After attempting to bribe people to do this for me, I actually made some progress on my own:
http://funkysoulrebels.com/calculator/
By god I am starting to actually understand this!
There...
LOL.. sometimes coding late at night is not the best idea. After racking my brain for a good hour, I realized that finding a charge by percent is a mathematical impossibility (unless I am calculating...
Argh.. I been trying to hook this up so that I can also type inside the percentage field and have that deduct the charge field (will do profit too once I figure this out) So far I havent been...
Thanks for taking the time to explain.. you make it sound so easy!
I suppose my problem with examples like these is that I tend to prefer explicit over clever code. I program in Ruby so maybe that...
Thanks for the code John..I cant believe how small a footprint it has. Of course I cant understand a word of it :P.
Trinithis's solution was more verbose, but I managed to twist it to suit my...
I have one last fish to fry before I go modular.
This one is truly baffling
var vdiscount = discount.value.trim();
var ndiscount = 1 - ((vdiscount*1)/100);
subtotal.value =...
Woops!
After testing this out thoroughly its not working just yet. Im still stepping on my own toes it seems and the calculations are not accurate when I add multiple events.
Gonna sleep on...
Actually, now that this is working, I have one last question.
At some point I will need to have multiple rows of these fields and I'm wondering how I can make this code more dynamic..IOW somehow...
Got it!
addEvent(
[cost, percent],
"keyup",
function(f) {
var vcost = cost.value.trim();
var vpercent = percent.value.trim();
var ncost = vcost*1;
Wow.. you certainly write some lovely code there. So clear and easy to follow!
It works a charm, although now just out of curiosity I wonder if I can extend it so that typing in a percentage will...
An image is worth a thousand words so:
http://funkysoulrebels.com/calc.gif
I basically want to have the user input the first two fields and have the last two get automagically calculated.
...