Can this program do calculations? -...

User 2675588 Photo


Registered User
15 posts

Thanks for everything.

I don't know how to thank you for all your help, but if you came to Europe, especially Luxembourg let me know.

Many Thanks

Nelson
User 187934 Photo


Senior Advisor
20,192 posts
Online Now

Your welcome.
I'll start talking to my wife about booking a trip.:lol:
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 19371 Photo


Registered User
1 post

So.. here I am stuck on a form problem. The same one, it seems. I'm trying to make a simple school lunch form that will total up each of the days selections and then provide a total of the selections. Apparently I shouldn't have bothered with the software and I am NOT ( BIG CAPITAL LETTERS) a programmer. I'm pretty good a snatching bits of code but not a programmer by anyone's imagination.
Suggestions?
User 187934 Photo


Senior Advisor
20,192 posts
Online Now

Link to form?
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 2524716 Photo


Registered User
3 posts

Hello Eric:

I am not a programmer either, but I'd really like to be able to add this capability to my forms.

Here is a form I just made that I would have to calculate manually and then bill. It would be a lot more convenient if I could have the form total everything up and then process the total charge when they submitted the form. Can you give me some guidance on how to do this?

http://skyhoundz.com/hyperflite_skyhoun … _form.html

TIA
User 2524716 Photo


Registered User
3 posts

Hello Eric:

I was trying to follow your examples, but, it's confusing, and I'm not doing something right.

I started by creating a copy of the form you linked to. Then, I copied your code and put it above my form. But, nothing happens. In Web Form Builder what Payment option is selected for the various fields?

https://skyhoundz.com/test_sale_form.html

TIA
User 103173 Photo


VP of Software Development
0 posts

You need to add it to the form page itself.

https://skyhoundz.com/Test_Form/Test_Form.html
Learn the essentials with these quick tips for Responsive Site Designer, Responsive Email Designer, Foundation Framer, and the new Bootstrap Builder. You'll be making awesome, code-free responsive websites and newsletters like a boss.
User 187934 Photo


Senior Advisor
20,192 posts
Online Now

You'll need to add an input with the name grandtotal.
Going by your original form.
<style>#docContainer input[name~=grandtotal]{display:none;}
</style><script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
//The inputs you want read only and the sumtotal class set to
$('input[name="grandtotal"]').attr('readonly', true);// name of grand total
$('input[name="package_type[]"]').addClass('cal');
$('input[name="medium_shirt"]').addClass('cal');
$('input[name="large_shirt"]').addClass('cal');
$('input[name="x-large_shirt"]').addClass('cal');
$('input[name="xx-l_shirt"]').addClass('cal');
$('input[name="black_cap"]').addClass('cal');
$('input[name="blue_cap"]').addClass('cal');
$('input[name="red_cap"]').addClass('cal');
$('input[name="additional_award_plaques"]').addClass('cal');
$('input[name="additional_competition_discs"]').addClass('cal');
$('input[name="additional_jaw_discs"]').addClass('cal');
$('input[name="additional_jaw_pup_discs"]').addClass('cal');

$('.cal').bind('keyup keypress blur click',function(){

// Deluxe Package ($199 plus shipping)
if ($("#item39_0_checkbox").is(':checked')) {
var subdeluxe = 199.00;
}else{var subdeluxe = 0;}

// Disc Dog T-Shirts (our choice) @ $12.95 each
var discdogtm = $('input[name="medium_shirt"]').val();
var discdogtl = $('input[name="large_shirt"]').val();
var discdogtxl = $('input[name="x-large_shirt"]').val();
var discdogtxxl = $('input[name="xx-l_shirt"]').val();
var totalitems1 = +discdogtm + +discdogtl + +discdogtxl + +discdogtxxl;
var subtotal1 = (totalitems1 * 12.95) ;

// Hyperflite Caps @ $12.95 each
var hypercapsblack = $('input[name="black_cap"]').val();
var hypercapsblue = $('input[name="blue_cap"]').val();
var hypercapsred = $('input[name="red_cap"]').val();
var totalitems2 = +hypercapsblack+ +hypercapsblue + +hypercapsred;
var subtotal2 = (totalitems2 * 12.95) ;

// Additional Award Plaques @ $9.95
var addawardplaques = $('input[name="additional_award_plaques"]').val();
var subtotal3 = (addawardplaques * 9.95) ;

// Competition discs @ $1.85 each
var addcompetitiondiscs = $('input[name="additional_competition_discs"]').val();
var subtotal4 = (addcompetitiondiscs * 1.85) ;

// Jawz discs @ $9.95 each
var addjawdiscs = $('input[name="additional_jaw_discs"]').val();
var subtotal5 = (addjawdiscs * 9.95) ;

// Jawz Pup discs @ $8.95 each
var addjawpupdiscs = $('input[name="additional_jaw_pup_discs"]').val();
var subtotal6 = (addjawpupdiscs * 8.95) ;

// Summing all the subtotals
var grandtotal = +subdeluxe+ +subtotal1+ +subtotal2 + +subtotal3 + +subtotal4 + +subtotal5 + +subtotal6;

// This will be your grand total
if (grandtotal !== '' && !isNaN(grandtotal)) {
$('input[name="grandtotal"]').val(grandtotal.toFixed(2));
}
});

});</script>
.
You can see it working here.
http://ericrohloff.com/coffeecup/ccforu … er-Bloeme/
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 406086 Photo


Registered User
23 posts

Great advice here, and you're awfully nice to help!

I have too many products available to set up an item for each one. So instead of doing it with presets and buttons, what I want to do is have them enter the item in text boxes. At the end of each line have 3 number boxes. They enter qty and price. the last one shows the total. Then at the bottom of the form there's a box for grand total.

Does that complicate the issue or make it simpler?
User 187934 Photo


Senior Advisor
20,192 posts
Online Now

Link to form?
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.