I was trying to understand why is it that when I click my radio button, I do not see the output of the total price, but when I ran my code in jsfiddle or in a seperate test.php page where I did not refer the script for the iCheck, the total price output was showing. How does the design of the iCheck interfere? And how can I fix this issue?
icheck.js
$(document).ready(function(){
$('input').iCheck({
checkboxClass: 'icheckbox_square-blue',
radioClass: 'iradio_square-blue',
increaseArea: '20%' // optional
});
});
price.js //outputs the Total price when the radio button is clicked
$(document).ready(function(){
//alert();
$(document).on("click", ".btn-checkbox-plan", function(e){
if($(".btn-checkbox-plan").is(':checked')){
$("#output").html($(this).val());
}
});
});
Code:
<div class="checkout">
<span id="checkout-title">Checkout</span>
<div class="plan-wrapper">
<input class="btn-checkbox-plan" type="radio" name="groupnine" value="$699" /> <label id="silver-plan">Silver Plan</label>
<label id="silver-plan-price">$699</label>
<input class="btn-checkbox-plan" type="radio" name="groupnine" value="$999" /> <label id="gold-plan"> Gold Plan</label>
<label id="gold-plan-price">$999</label>
</div>
<div class="logo-wrapper">
<span id="personalized-logo">Personalized Logo</span>
<span id="logo-price">$49.99</span>
</div>
<div class="tax-wrapper">
<div class="wrapper-a">
<span id="tax">Tax + Processing</span>
<span id="tax-price">$0.00</span>
</div>
</div>
<div class="total-wrapper">
<div class="wrapper-b">
<span id="total">Total</span>
<output type="number" name="price" id="output"></output>
</div>
</div>
<div class="controls submit-btn">
<input type="submit" value="Checkout" />
<input type="reset" value="Clear" />
</div>
<div class="controls back-btn">
<input class="back-button" type="button" value="Back" />
</div>
</div>