Adding a percentage/totals

User 2758418 Photo


Guest
14 posts

For reference, this is what I'm wanting to do. PayPal's fees, 2.9% (valsix) + $.30 (valfive) per transaction.
http://www.coffeecup.com/forums/web-for … art-total/

I have multiple items (4). I'm not too savvy with coding so I can't get this to work. Here is my code. Item68 is the Total. 42, 43, 54, and 60 are inputs, items.

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script> <script type="text/javascript">$(document).ready(function(){
$('#item68_number_1').attr('readonly', true);
$('#item42_number_1').keyup(function(){
$('#item43_number_1').keyup(function(){
$('#item54_number_1').keyup(function(){
$('#item60_number_1').keyup(function(){
var valone = $('#item42_number_1').val();
var valtwo = $('#item43_number_1').val();
var valthree = $('#item54_number_1').val();
var valfour= $('#item60_number_1').val();
var valfive= .30;
var valsix = .029;
var total = (((valone + valtwo + valthree + valfour ) * (valfive)) + (valsix));
$('#item68_number_1').val(total.toFixed(2));
});
});</script>


Thank you
User 187934 Photo


Senior Advisor
20,271 posts

Not totally sure what your actually looking for in your calculations. Your descriptions says one thing and the code attempt says another. Please clarify with a standard math equation.
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
User 2758418 Photo


Guest
14 posts

Sorry. Basically what I'm looking to do is what you had done at the above link but with more items than just one. I have four items that need to be added together before the PayPal rates/fees are applied.
I hope that clears it up?
User 187934 Photo


Senior Advisor
20,271 posts

Are the items a price or a number count?
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
User 2758418 Photo


Guest
14 posts

Number count.
User 187934 Photo


Senior Advisor
20,271 posts

David, why are you showing as a Guest in the forum?
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
User 2758418 Photo


Guest
14 posts

Honestly, I do not know other than I haven't changed it in my profile.
User 187934 Photo


Senior Advisor
20,271 posts

Do you own a Coffeecup app?
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
User 2758418 Photo


Guest
14 posts

Yes, Web Form.
User 187934 Photo


Senior Advisor
20,271 posts

You should sign into your CC account and post this question to the formbuilder thread. I can move it there instead after your logged in.
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com

Have something to add? We’d love to hear it!
You must have an account to participate. Please Sign In Here, then join the conversation.