Calculator

Please Fill the data

You need


0 liters

` // $(".exterior").hide(); jQuery(document).ready(function($) { function change_type(type) { if(type=="INTERIOR") { $(".exterior").hide(); $(".interior").show(); $("#danger").hide(); $("#selectedProduct2").val(0).trigger("change"); } if(type=="EXTERIOR") { $(".exterior").show(); $(".interior").hide(); $("#danger").hide(); $("#selectedProduct").val(0).trigger("change"); } } function change_product(prod) { if(prod=="0") { var src='https://demo.almawan.com/wp-content/uploads/2022/09/'+prod+'.jpg'; } else { var src='https://demo.almawan.com/wp-content/uploads/2022/09/'+prod+'.jpeg'; } $("#product_image").attr('src',src); } function cal() { var wall_type=$("#wall_type").val(); // var length_ex=$("#length_ex").val(); // var breadth_ex=$("#breadth_ex").val(); // var height_ex=$("#height_ex").val(); var paint_type=$("#paint_type").val(); var width_in=$("#width_in").val(); var height_in=$("#height_in").val(); if(wall_type=="INTERIOR") { var selectedProduct=$("#selectedProduct").val(); } if(wall_type=="EXTERIOR") { var selectedProduct=$("#selectedProduct2").val(); } var numberofwindows=$("#numberofwindows").val(); var numberofdoors=$("#numberofdoors").val(); pain_num=1; repaint_num=1; $("#danger").hide(); // if(wall_type=="INTERIOR") // { if(width_in==0 || width_in=="" || width_in=="0") { $("#danger").html("You must enter the width"); $("#danger").show(); $("#width_in").focus(); return false; } if(width_in<0) { $("#danger").html("You must enter the width correctly"); $("#danger").show(); $("#width_in").focus(); return false; } if(height_in==0 || height_in=="") { $("#danger").html("You must enter the height"); $("#danger").show(); $("#height_in").focus(); return false; } if(height_in<0) { $("#danger").html("You must enter the height correctly"); $("#danger").show(); $("#height_in").focus(); return false; } // } // if(wall_type=="EXTERIOR") // { // if(length_ex==0 || length_ex=="" || length_ex=="0") // { // $("#danger").html("You must enter the length"); // $("#danger").show(); // $("#length_ex").focus(); // return false; // } // if(length_ex<0) // { // $("#danger").html("You must enter the length correctly"); // $("#danger").show(); // $("#length_ex").focus(); // return false; // } // if(breadth_ex==0 || breadth_ex=="") // { // $("#danger").html("You must enter the breadth"); // $("#danger").show(); // $("#breadth_ex").focus(); // return false; // } // if(breadth_ex<0) // { // $("#danger").html("You must enter the breadth correctly"); // $("#danger").show(); // $("#breadth_ex").focus(); // return false; // } // if(height_ex==0 || height_ex=="") // { // $("#danger").html("You must enter the height"); // $("#danger").show(); // $("#height_ex").focus(); // return false; // } // if(height_ex<0) // { // $("#danger").html("You must enter the height correctly"); // $("#danger").show(); // $("#height_ex").focus(); // return false; // } // } if(selectedProduct==0) { $("#danger").html("You must select the product"); $("#danger").show(); $("#selectedProduct").focus(); return false; } if( numberofwindows=="") { $("#danger").html("You must enter the number of windows"); $("#danger").show(); $("#numberofwindows").focus(); return false; } if(numberofwindows<0) { $("#danger").html("You must enter the number of windows correctly"); $("#danger").show(); $("#numberofwindows").focus(); return false; } if(numberofdoors=="") { $("#danger").html("You must enter the number of doors"); $("#danger").show(); $("#numberofdoors").focus(); return false; } if(numberofdoors<0) { $("#danger").html("You must enter the number of doors correctly"); $("#danger").show(); $("#numberofdoors").focus(); return false; } var surface_area; var door_area=1.9; var wind_area=1.44; if(selectedProduct=="101") { pain_num=9; repaint_num=12; } if(selectedProduct=="107") { pain_num=12; repaint_num=15; } if(selectedProduct=="108") { pain_num=14; repaint_num=16; } // if(wall_type=="INTERIOR") // { surface_area=height_in*width_in; console.log(surface_area); total_surface_area=surface_area; console.log(total_surface_area); painting_surface_area = total_surface_area - (numberofdoors * door_area) - (numberofwindows* wind_area); console.log(painting_surface_area); console.log(pain_num); console.log(repaint_num); if(paint_type=="paint") { $("#result_liters").html( (painting_surface_area/pain_num).toFixed(2)+" Liters"); } if(paint_type=="repaint") { $("#result_liters").html((painting_surface_area/repaint_num).toFixed(2)+" Liters"); } // } } });