Questions tagged [jquery-calculation]
103 questions
0
votes
1 answer
Jquery window resize flickering and wrong calculation on sticky footer
I made a simple sticky footer. It makes everything fit nicely when the page loads, but flickers and doesn't put the footer where it should go on re-size. Any ideas?
$(window).on("resize", function () {
$(".site-footer").css("padding-top", $(…

Leopold Kristjansson
- 2,246
- 28
- 47
0
votes
3 answers
use JQuery to total cells in a row
I'm using asp.net with master pages. I have a listview that is producing 8 rows. What I would like to use jQuery to do is, when someone enters a value in cell 1-7, when they leave the cell i'd like to calculate cells 1-7 and put that value in cell…

jvcoach23
- 2,765
- 10
- 34
- 50
0
votes
2 answers
JavaScript if statement with extra condition
I have a JavaScript if statement that does the following:
If a payment method called cardless is chosen, then the cardfee varable is set to be 1% of the total fee.
if (document.getElementById('payment_method').value == "Cardless") {
cardfee =…

Tommy Smith
- 13
- 4
0
votes
5 answers
jQuery Form Calculation - Works, but strange results
I have a form with inputs laid out correctly using ID's etc. I have deployed a little jQuery function to calculate the form variables. In essence I want to calculate the total VAT and then the Grand Total.
The code example was taken from…

Nick Green
- 428
- 3
- 8
- 18
0
votes
2 answers
How to modify a result in calculation?
Formula is (val x 0.5) + 50 = result, but if result is greater then 200, then override result to 150
My if is
if (val > 200) {
result = 150
}

Trina Thornbury
- 3
- 1
0
votes
2 answers
Undesired effects when calculating 2 amounts with jQuery
I am not getting the desired output with this code. Everything seems to be working except if for example you enter anything between 100 - 199. It gives a negative number in the other box, when I would like it to just split the balance into both…

souporserious
- 2,079
- 2
- 27
- 47
0
votes
3 answers
jQuery Live Calculation Round Answer
The below solution works great for a simple live calculation however, I am trying to make one small change. I want to round the answer always to 2 decimal places. I have tried adding .toFixed(2) to various points but it doesn't seem to work. Like…

user1098178
- 697
- 3
- 9
- 25
0
votes
1 answer
jQuery total number of lines for a speaker
Error with code;
$(document).ready(function(){
loadPlay();
$("#term_search").focus(function(event) {
$(this).val("");
});

user2321845
- 5
- 3
0
votes
3 answers
Result format right Jquery Function
I have a code fast and quiet, but results in some calculations are formatted very large, including, the value obtained does not enter the calculation. How to do this see the right result?
I would like the result of the calculation (3 * 2215.40) was…

bda.awk
- 29
- 6
0
votes
1 answer
Calculate and output average from jQuery UI sliders
I try to make it as simple as possible: I have six jQuery UI sliders, I need to take their values if they're value is different from 0, and display an average, and is driving me crazy so far.
Basically I have six of these (their names go from…

djwd
- 315
- 2
- 5
- 15
0
votes
2 answers
Calculator: Get total sum from single input
I'm currently building my first calculator in jQuery and I have some problems with the total sum of the value in the input. I'm not using more than one input because I want to keep it simple and easy to use. The code below prints NaN and I don't…

Airikr
- 6,258
- 15
- 59
- 110
0
votes
2 answers
javascript formula calculations
I have a rather complex formula that I want to recreate with code, I have set up a fiddle
But I have no idea where to start with the JavaScript/jQuery?
Any help to get me started and point me in the right direction would be wonderful.
The formula I…

user1681836
- 51
- 8
0
votes
2 answers
show total in jquery ajax without click on text field
I am using this to calculate total. Here is the total script