A form that adds up total - Post ID...

User 2246262 Photo


Registered User
2 posts

Hi There,
I would like to create 5 fields which users can add a number or score and then for the totals of each to be added up.

Example:
Score 1 = 5
Score 2 = 15
Score 3 = 10
Score 4 = 20
Score 5 =50
GRAND TOTAL = 100
Is there any way or anyone that can do that for me? Happy to pay someone.
See attached for general layout.
Cheers
Peter
Attachments:
User 187934 Photo


Senior Advisor
19,022 posts
Online Now

Hi PMUSCET,
Yes this can be done.
Can you share a link to your form so I can see the actual inputs.
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 2246262 Photo


Registered User
2 posts

Hi Eric,
here is the link http://www.wineshowcasemedia.com/wine%2 … te%20form/
I have not populated all the drop down numbers & the first one showing 50 should not have any other numbers as that is the starting base.
Cheers
Peter
User 187934 Photo


Senior Advisor
19,022 posts
Online Now

This should work for ya based on given info.
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script>
var jQ = $.noConflict(true);
jQ(document).ready(function(){
jQ('input[name="text20"]').prop('readonly','true');
jQ('select').on('change', function() {
var sum_total = 0;
jQ('select').not(jQ('select[name="select1"]')).each(function(){
var amount = parseInt(jQ(this).val());
if(amount > 0){
sum_total += parseFloat(this.value);
jQ('input[name="text20"]').val(sum_total);
}
});
}).change();
});
</script>

Working here.
https://ericrohloff.com/coffeecup/ccfor … form1.html
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.