Bill Percentage of Total - Page 2

User 187934 Photo


Senior Advisor
20,271 posts

It can get confusing. If you look at my code on my example you can see how you apply the variable to the particular input then use that variable in an equation. Then you apply the result of the equation to a total input.
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 2377814 Photo


Registered User
45 posts

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script> <script type="text/javascript">$(document).ready(function(){
$('#item65_text_1').attr('readonly', true);
$('#item1_number_1').keyup(function(){
var valone = $('#item55_select_1').val() + ('#item8_select_1').val() + ('#item9_select_1').val() + ('#item10_select_1').val() + ('#item11_select_1').val() + + ('#item14_number_1').val();
var valtwo = 1.04;
var total = ((valone * valtwo) + (valtwo));
$('#item65_text_1').val(total.toFixed(2));
});
});</script>

I hope Im getting close with this... ive input the first set of id names (these boxes are repeated three times in order to allow the customer to place three different orders within the same form, once I get the coding right il add the rest)

Im not too sure what I need to be putting in keyupfunction
User 2377814 Photo


Registered User
45 posts

item65_text_1 is a read only text box called [Grand-Total] which is to display the order total + 4%
User 187934 Photo


Senior Advisor
20,271 posts

Can you share the fb file or the html of the 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 2377814 Photo


Registered User
45 posts

Ive included the first part of the text, because overall its 1500 lines long. If I can get this working then I can just add the other terms later to the working code.

The cart total plus 4% doesnt have to be shown to the customer on the form, but it does need to appear on the confirmation - so Im going to need to call on it with a [name] to display it's total. Or better still, to have a box calculating 4% then have this added to the _cart_total_ (so the cart total then includes the 4% transaction fee) but I dont know if that's possible.

Following on from that I need to show 50% of the grand total (cart total + 4%) as this is the deposit the customer needs to pay.


<div class="fb-item fb-100-item-column fb-two-column" id="item52" style="opacity: 1;">
<div class="fb-grouplabel">
<label id="item52_label_0" style="display: inline;">Place An Order For</label>
</div>
<div class="fb-radio">
<label id="item52_0_label"><input name="Order" id="item52_0_radio" required type="radio" data-hint="" value="Custom Trophy" /><span class="fb-fieldlabel" id="item52_0_span">Custom Trophy</span></label>
<label id="item52_1_label"><input name="Order" id="item52_1_radio" type="radio" value="Custom product2" /><span class="fb-fieldlabel" id="item52_1_span">Custom product2</span></label>
</div>
</div>
<div class="fb-item" id="item7">
<div class="fb-sectionbreak">
<hr style="max-width: 673px;">
</div>
</div>
<div class="fb-item fb-33-item-column fb_cond_applied" id="item55">
<div class="fb-grouplabel">
<label id="item55_label_0" style="display: inline;">product2 - &pound;199</label>
</div>
<div class="fb-dropdown">
<select name="product2" id="item55_select_1" data-hint="">
<option id="item55_0_option" selected value="1 x product2">
1 x product2
</option>
</select>
</div>
</div>
<div class="fb-item fb-66-item-column fb_cond_applied" id="item57" style="opacity: 1;">
<div class="fb-grouplabel">
<label id="item57_label_0" style="display: inline;">Name of Title</label>
</div>
<div class="fb-input-box">
<input name="Title-Name" id="item57_text_1" required type="text" maxlength="254"
placeholder="" data-hint="" autocomplete="off" />
</div>
</div>
<div class="fb-item fb-50-item-column fb_cond_applied" id="item8">
<div class="fb-grouplabel">
<label id="item8_label_0" style="display: inline;">Select Your Order</label>
</div>
<div class="fb-dropdown">
<select name="Trophy-Order" id="item8_select_1" required data-hint="">
<option id="item8_0_option" selected value="">
Choose one
</option>
<option id="item8_1_option" value="3 Plate Chrome Trophy - &pound;499">
3 Plate Chrome Trophy - &pound;499
</option>
<option id="item8_2_option" value="3 Plate Nickel Trophy - &pound;519">
3 Plate Nickel Trophy - &pound;519
</option>
<option id="item8_3_option" value="3 Plate Gold Trophy - &pound;555">
3 Plate Gold Trophy - &pound;555
</option>
<option id="item8_4_option" value="5 Plate Chrome Trophy - &pound;575">
5 Plate Chrome Trophy - &pound;575
</option>
<option id="item8_5_option" value="5 Plate Nickel Trophy - &pound;595">
5 Plate Nickel Trophy - &pound;595
</option>
<option id="item8_6_option" value="5 Plate Gold Trophy - &pound;675">
5 Plate Gold Trophy - &pound;675
</option>
<option id="item8_7_option" value="Custom Chrome Trophy - &pound;650">
Custom Chrome Trophy - &pound;650
</option>
<option id="item8_8_option" value="Custom Nickel Trophy - &pound;699">
Custom Nickel Trophy - &pound;699
</option>
<option id="item8_9_option" value="Custom Gold Trophy - &pound;1150">
Custom Gold Trophy - &pound;1150
</option>
</select>
</div>
</div>
<div class="fb-item fb-50-item-column fb_cond_applied" id="item9">
<div class="fb-grouplabel">
<label id="item9_label_0" style="display: inline;">Further Options</label>
</div>
<div class="fb-dropdown">
<select name="Further-Options" id="item9_select_1" data-hint="">
<option id="item9_0_option" selected value="None">
None
</option>
<option id="item9_1_option" value="Relief Plating - &pound;200">
Relief Plating - &pound;200
</option>
</select>
</div>
</div>
<div class="fb-item fb-50-item-column fb_cond_applied" id="item10">
<div class="fb-grouplabel">
<label id="item10_label_0" style="display: inline;">Front Colour</label>
</div>
<div class="fb-dropdown">
<select name="Front-Colour" id="item10_select_1" data-hint="">
<option id="item10_0_option" selected value="Black - INCLUDED">
Black - INCLUDED
</option>
<option id="item10_1_option" value="Blue - &pound;60">
Blue - &pound;60
</option>
<option id="item10_2_option" value="Red - &pound;60">
Red - &pound;60
</option>
<option id="item10_3_option" value="Purple - &pound;60">
Purple - &pound;60
</option>
<option id="item10_4_option" value="Green - &pound;60">
Green - &pound;60
</option>
</select>
</div>
</div>
<div class="fb-item fb-50-item-column fb_cond_applied" id="item11" style="opacity: 1;">
<div class="fb-grouplabel">
<label id="item11_label_0" style="display: inline;">Back Colour</label>
</div>
<div class="fb-dropdown">
<select name="Back-Colour" id="item11_select_1" data-hint="">
<option id="item11_0_option" selected value="Black - INCLUDED">
Black - INCLUDED
</option>
<option id="item11_1_option" value="Blue - &pound;40">
Blue - &pound;40
</option>
<option id="item11_2_option" value="Red - &pound;40">
Red - &pound;40
</option>
<option id="item11_3_option" value="Purple - &pound;50">
Purple - &pound;40
</option>
<option id="item11_4_option" value="Green - &pound;60">
Green - &pound;40
</option>
</select>
</div>
</div>
<div class="fb-item fb-side-by-side fb-33-item-column fb_cond_applied"
id="item12" style="opacity: 1;">
<div class="fb-grouplabel">
<label id="item12_label_0" style="display: inline;">Add Crystals?</label>
</div>
<div class="fb-radio">
<label id="item12_0_label"><input name="Crystals" id="item12_0_radio" required type="radio" data-hint="" value="Yes" /><span class="fb-fieldlabel" id="item12_0_span">Yes</span></label>
<label id="item12_1_label"><input name="Crystals" id="item12_1_radio" required type="radio" value="No" /><span class="fb-fieldlabel" id="item12_1_span">No</span></label>
</div>
</div>
<div class="fb-item fb-33-item-column fb_cond_applied" id="item13">
<div class="fb-grouplabel">
<label id="item13_label_0" style="display: inline;">Select Crystal Colour</label>
</div>
<div class="fb-dropdown">
<select name="Crystal-Colour" id="item13_select_1" data-hint="">
<option id="item13_0_option" selected value="Clear">
Clear
</option>
<option id="item13_1_option" value="Blue">
Blue
</option>
<option id="item13_2_option" value="Green">
Green
</option>
<option id="item13_3_option" value="Red">
Red
</option>
<option id="item13_4_option" value="Amber">
Amber
</option>
<option id="item13_5_option" value="AB">
AB
</option>
</select>
</div>
</div>
<div class="fb-item fb-33-item-column fb_cond_applied" id="item14">
<div class="fb-grouplabel">
<label id="item14_label_0" style="display: inline;">Quantity - &pound;1 each</label>
</div>
<div class="fb-input-number">
<input name="Crystal-Number" id="item14_number_1" type="number" min="0"
max="999999999" step="1" data-hint="" autocomplete="off" />
</div>
</div>
User 187934 Photo


Senior Advisor
20,271 posts

Where's your total input?
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 2377814 Photo


Registered User
45 posts

Hi Eric,

By 'total input' do you mean the box in which the calculated total will be shown?

Its at the bottom of the form and the script is this-

<div class="fb-item fb-50-item-column" id="item65">
<div class="fb-grouplabel">
<label id="item65_label_0" style="display: inline;">Grand Total Inc. 4% Transaction Fee &pound;</label>
</div>
<div class="fb-input-box">
<input name="Grand-Total" disabled id="item65_text_1" type="text" maxlength="254"
placeholder="" autocomplete="off" data-hint="" />
</div>
</div>
User 187934 Photo


Senior Advisor
20,271 posts

The problem is going to be that your going to need a lot of if statements to catch your drop down values. Not easily done.
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 2377814 Photo


Registered User
45 posts

Yeah i figured, think it's about 12 in total :(
User 2377814 Photo


Registered User
45 posts

Just a thought... but is there no way to edit form builder's native _cart_total_ code and make this add 4% to its calculation?

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.