I've keep getting this error from JavaScript. It happens each time I select/deselect ckhDirectDebit checkbox.
Here is the code:
<script type="text/javascript">
$(document).ready(function () {
var isDirectDebitSelected = $('#<%=chkDirectDebit.ClientID%>');
var sameAsMerchantBankCheckbox = $('#<%=chkSameAsMerchantBank.ClientID%>');
var sameAsMerchantBankLabel = $('#<%=txtSameAsMerchantBank.ClientID%>');
function setSameAsMerchantVisible() {
if (isDirectDebitSelected.is(':checked')) {
sameAsMerchantBankCheckbox.show();
sameAsMerchantBankLabel.show();
} else {
sameAsMerchantBankCheckbox.hide();
sameAsMerchantBankLabel.hide();
}
isDirectDebitSelected.bind('change', function () {
setSameAsMerchantVisible();
});
setSameAsMerchantVisible();
}
});
</script>
<asp:CheckBox runat="server" ID="chkDirectDebit" />
<asp:Label runat="server" AssociatedControlID="chkSameAsMerchantBank" ID="txtDirectDebit" meta:resourcekey="lblDirectDebit"></asp:Label>
<asp:CheckBox runat="server" ID="chkSameAsMerchantBank" OnCheckedChanged="chkSameAsMerchantBank_CheckedChanged" AutoPostBack="True" Checked="True" />
<asp:Label runat="server" AssociatedControlID="txtSameAsMerchantBank" ID="txtSameAsMerchantBank" meta:resourcekey="lblSameAsMerchantBank"></asp:Label>
Anyone knows what I'm doing wrongly in js? And what is the potential problem that causes this exception?
setSameAsMerchantVisiblecalled always and you get infinite recursion - GrundysetSameAsMerchantVisible()fromsetSameAsMerchantVisible, what are you expecting??? - A. Wolff