Reputation: 77
i am using check box results input page i have check box code looks like
<input name="upfrontMIPPc" id="upfrontMIPPc1" type="text" class="txt" size="3" maxlength="3" onChange="javascript:upfrontMIPPcChanged(true)" />
<div class="col-md-1 padding-lft" style="right:13px;top:3px">
<input id="chkUFtoLoan-1" name="S" type="checkbox" />
</div>
this check box name pass another page i have using php file i have used post method Looks like
$S = $_POST["S"];
Results i have two section of value of check box
1.About Your Loan
2.Buyer Cost To Close
Check box input fields name value upfront MIP.
if the user checked the Include In Calc button from the input page.
They should all be defaulted to checked (as we are defaulting to adding the UPFRONT MIP balance to the loan).
But if they uncheck the checkboxes, then the value gets placed in the Buyer Costs To Close Section?
how to display value depends check box checked or unchecked ?
MY js fiddle Link : https://jsfiddle.net/2dgp0drd/2/
Upvotes: 0
Views: 1145
Reputation: 142
Try this:
$(document).ready(function(){
var check;
// Example 1 - With checked
$("#test1").on("click", function(){
if(checkbox1.checked) {
alert("checked.");
} else {
alert("unchecked.");
}
});
// Example 2 - With jQuery is, NOTE - :checked
$("#test2").on("click", function(){
check = $("#checkbox1").is(":checked");
if(check) {
alert("checked.");
} else {
alert("unchecked.");
}
});
});
Upvotes: 2