Update js/Weight Calculation Script-Edited-Jquery-V4.js

Previous script overwrote final weight.
This commit is contained in:
2018-10-29 18:21:45 -04:00
parent 9032402dc9
commit 74285d5fb2

View File

@@ -153,8 +153,9 @@
jQuery(".input-calculate").click(function(){ jQuery(".input-calculate").click(function(){
//sets bar weight to current inputed bar weight //sets bar weight to current inputed bar weight
var bar = jQuery(".input-bar").val(); var bar = jQuery(".input-bar").val();
//checks if the weight input is less than or equal to the bar weight. If it is, update the weigh input and final weight display. //checks if the weight input empty. If it is, update the weigh input as the bar weight and final weight display.
if (jQuery(".input-weight").val() <= bar) { if (jQuery(".input-weight").val() == "") {
console.log("fired");
jQuery(".input-weight").val(bar); jQuery(".input-weight").val(bar);
jQuery(".input-final").html(bar); jQuery(".input-final").html(bar);
} }