Calculate totals in Web Form Builder?...

User 1982097 Photo


Registered User
72 posts

ok thx
Coffee roasting is my passion - seriously
User 1982097 Photo


Registered User
72 posts

Having a problem withthe jquery I tink.

http://givingbean.com/ez/0515test/0515test.html

the total at the bottom calculated by the jquery items_total is adding an extra item.
It is also invalidating the total value field. I can't find the cause. Can you look?

Thx much -
Coffee roasting is my passion - seriously
User 187934 Photo


Senior Advisor
20,239 posts

Add this to the not: list.
input[name="fb_js_enable"]
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 2853792 Photo


Registered User
14 posts

Good Day To All,

I was always terrible at math but decent in programming yet I cannot figure this out for the life of me.. I have been studying the examples in this topic now for hours and cannot figure out how to do this :( Please someone, if anyone can help me with this.

I have a form to calculate the amount of chlorine needed in a cistern. The variables are as follows:

For the Cistern Level % I have a drop down called cisternLevel with 0,25,50,75 and 100 as the values.
For the Test Strip Results I have a drop down called cisternStrip with 0,0.5,1,2,5 as the values.

I then have a text field "Chlorine To Add" called cisternChlorine

cisternLevel.....cisternStrip.....cisternChlorine
100..................0......................1.4
75....................0......................1.0
50....................0......................0.75
25....................0......................0.35
100..................0.5...................1.0
75....................0.5...................0.75
50....................0.5...................0.5
25....................0.5...................0.25
ANY.................1......................0
ANY.................2......................0
ANY.................5......................0

How can I get the cisternChlorine field to reflect those amounts? My head hurts!
User 2853792 Photo


Registered User
14 posts

After playing around in photoshop I came up with a bunch of png's that reflect a bottle of chlorine with sizes on them and set the Show Element to display the right size bottle when cisternLevel (AND) cisternStrip equal something. This looks great on the form but there is no way to add what image it is using to the confirmation page or Notification email. So I still must figure something out.. However after adding all these IF % AND % SHOW IMG it made me think since I only need a limited amount of answers, is there some syntax I can use to simply say :

IF cisternLevel = 100 AND cisternStrip = 0 THEN cisternChlorine = 1.4L
OR
IF cisternLevel = 75 AND cisternStrip = 0 THEN cisternChlorine = 1L

etc..

Is this possible?
User 187934 Photo


Senior Advisor
20,239 posts

Hi Richard,
I can probably help you but I need to see that actual form. This insures I'm not doing things that aren't need that may cause confusion.
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 2076706 Photo


Registered User
72 posts

Hi,

PMFJI.

I need script to total 5 items.

i.e.
GRANDTOTAL = COST1+COST2+COST3+COST4+COST5

Hope someone has knowledge and time to help.
>don<
User 187934 Photo


Senior Advisor
20,239 posts

Hi Don,
Can you share a link to your 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 187934 Photo


Senior Advisor
20,239 posts

Give this a try.
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script>
var jQ = $.noConflict(true);
// version 1

function calctotal(){
var total = 0;
jQ("input[name^='COST']").each(function(){
var value = jQ(this).val();
if(value >0 && jQ.isNumeric(value)){
total+=parseFloat(jQ(this).val(),10);
}
});
jQ("input[name=GrandTotal]").val(total.toFixed(2))
}
jQ().ready(function(){
jQ("input[name^='COST']").change(function(){
calctotal()
});
});
</script>
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.