I have some values that post back to a parent form from a child form and fire this method
function OnClientClose(oWnd, args) {
//get the transferred arguments
var arg = args.get_argument();
if (arg) {
var agreementId = $find("<%= rtxtAgreementId.ClientID %>");
var legacyReinsurerId = $find("<%= rtxtlegacyReinsurerId.ClientID %>");
agreementId.set_value(arg.ReinsuranceAgreementId);
legacyReinsurerId.set_value(arg.LegacyReinsurerId);
$("<%= chkCommutationFlag.ClientID %>").prop("checked", Boolean(arg.CommutationFlag));
}
};
all arguments have the proper values including Boolean(arg.CommutationFlag) as I tested this by displaying the value in a textbox, but my checkbox display value does not change. I have tried various methods to set the checkbox value and they all process without throwing an error but the checkbox remains unchecked. What am I missing?
Start by checking if you are actually hitting the target, replace prop with some mundane css instead to see if the checkbox changes apperance.
If it does’nt your ID is wrong, and remember that you need # before the ID.
If it does change, replace your boolean with the actual word “true”, if that fixes it your boolean is wrong, and it’s probably one or the other.
Just to make sure you could place an alert right above your checkbox code to see that your script is getting that far, but if the console shows no errors, and if the css approach works, that’s not it.