I have a calulcator in my form to calculate my dropdown options choices.
$(function() {
$(\"select.calculate\").on(\"change\", calc);
$(\"input[type=checkbo
var basePrice = 60;
$(document).ready(function() {
$("select.calculate").on("change", calc);
$("input[type=checkbox].calculate").on("click", calc);
$("#item-price").html(basePrice);
$("#item_price_val").val(basePrice);
});
function calc() {
newPrice = basePrice;
$("select.calculate option:selected,input[type=checkbox].calculate:checked").each(function() {
newPrice += parseInt($(this).data('price'), 10);
});
newPrice = newPrice.toFixed(2);
$("#item-price").html(newPrice);
$("#item_price_val").val(newPrice);
}
Please Use an updated version of your code.