IE7/jquery 1.4.2 checkbox issue
We have a web page that contains a set of check boxes that represent different taxes. There is logic between those taxes, for example, if you charge tax1, you must also charge tax2, etc., and we use check/uncheck related checkboxes. Please see the end of this post for the javascript.
By looking at the code, there is no way for anyone to turn on both gstCheckbox and bulkCheckbox, but one of my colleague managed to do so in IE7. I tried in FF and wasn't able to repeat this issue there.
Can anyone spot anything obvious or have run into similar situation (with IE 7 and jquery)?
- $(document).ready(function() {
- var hstEnabled = $("#ctl00_ContentPlaceHolder_Hst").attr("value");
- if (hstEnabled == "1") {
- $('label[for="ctl00_ContentPlaceHolder_pstCheckBox"]').html("harmonized sales tax");
- $('label[for="ctl00_ContentPlaceHolder_gstCheckBox"]').html("federal sales tax only");
- $("#ctl00_ContentPlaceHolder_lstCheckBox").parent().parent().remove();
- $("#ctl00_ContentPlaceHolder_pstCheckBox").click(function() {
- //enableTaxSection(false);
- if (!$("#ctl00_ContentPlaceHolder_pstCheckBox").attr("checked")) {
- $("#ctl00_ContentPlaceHolder_fntCheckBox").attr("checked", false);
- $("#ctl00_ContentPlaceHolder_bulkCheckBox").attr("checked", false);
- turnOffTabacoo();
- } else {
- $("#ctl00_ContentPlaceHolder_gstCheckBox").attr("checked", false);
- }
- //enableTaxSection(true);
- });
- //click event handler for gst
- $("#ctl00_ContentPlaceHolder_gstCheckBox").click(function() {
- //enableTaxSection(false);
- if ($("#ctl00_ContentPlaceHolder_gstCheckBox").attr("checked")) {
- $("#ctl00_ContentPlaceHolder_pstCheckBox").attr("checked", false);
- $("#ctl00_ContentPlaceHolder_fntCheckBox").attr("checked", false);
- $("#ctl00_ContentPlaceHolder_bulkCheckBox").attr("checked", false);
- turnOffTabacoo();
- }
- //enableTaxSection(true);
- });
- $("#ctl00_ContentPlaceHolder_fntCheckBox").click(function() {
- //enableTaxSection(false);
- if ($("#ctl00_ContentPlaceHolder_fntCheckBox").attr("checked")) {
- $("#ctl00_ContentPlaceHolder_pstCheckBox").attr("checked", true);
- $("#ctl00_ContentPlaceHolder_gstCheckBox").attr("checked", false);
- } else {
- turnOffTabacoo();
- }
- //enableTaxSection(true);
- });
- //click event handler for bulk
- $("#ctl00_ContentPlaceHolder_bulkCheckBox").click(function() {
- //enableTaxSection(false);
- if ($("#ctl00_ContentPlaceHolder_bulkCheckBox").attr("checked")) {
- $("#ctl00_ContentPlaceHolder_pstCheckBox").attr("checked", true);
- $("#ctl00_ContentPlaceHolder_gstCheckBox").attr("checked", false);
- }
- //enableTaxSection(true);
- });
- $("#ctl00_ContentPlaceHolder_itemTypeDropDownList").change(function() {
- //enableTaxSection(false);
- if ($("#ctl00_ContentPlaceHolder_itemTypeDropDownList").val() == "18" || $("#ctl00_ContentPlaceHolder_itemTypeDropDownList").val() == "19") {
- $("#ctl00_ContentPlaceHolder_pstCheckBox").attr("checked", true);
- $("#ctl00_ContentPlaceHolder_fntCheckBox").attr("checked", true);
- $("#ctl00_ContentPlaceHolder_gstCheckBox").attr("checked", false);
- }
- //enableTaxSection(true);
- });
- }
- });