View Single Post
Old 02-13-2013, 06:34 PM   PM User | #3
moonbeam429
New to the CF scene

 
Join Date: Feb 2013
Posts: 8
Thanks: 2
Thanked 0 Times in 0 Posts
moonbeam429 is an unknown quantity at this point
I actually re-wrote the entire code and it works now. I am sure there is another way that is probably better and shorter but I am not an experienced coder. I am slowly learning. Now off to get the decimals, comma's and to get the other to round off is going to be difficult. Here is an example of the code I wrote so you can see what I was trying to do.

Code:
function totalpower(){
c5=formatinput(document.form.c5.value);
document.form.c5.value=c5;
e5=formatinput(document.form.e5.value);
document.form.e5.value=e5;

c6=formatinputfloat(document.form.c6.value);
document.form.c6.value=c6;
e6=formatinputfloat(document.form.e6.value);
document.form.e6.value=e6;

sum=(c5 * c6);
document.form.sum.value=formatinput(sum);
ledsum=(e5 * e6);
document.form.ledsum.value=formatinput(ledsum);
}

<input name="c5" style="background-color: #d6d6d6" onChange="totalpower()" />
<input name="c6" style="background-color: #d6d6d6" onChange="totalpower()" />
<input name="sum"  value="">
moonbeam429 is offline   Reply With Quote