I have a curious issue. Testing my JS as I go, found that I can only check and un-check a checkbox once.
Here is my HTML. I've tried both registering with a script tag and registering with the dnn minification process. No joy. With Chrome Dev Tools the same thing happens. I can check it with the attribute set true, uncheck it with the attribute set false. Subsequent tries don't work.
This doesn't happen at work with straight up ASP.Net sites using JS. This must be something peculiar to user controls.
Here is the js I'm testing with:
// JavaScript source code
$(function () {
$('#chkDetails').attr('checked', true);
$('#chkDetails').attr('checked', false);
$('#chkDetails').attr('checked', true);
$('#chkDetails').attr('checked', false);
$('#chkDetails').attr('checked', true);
});
HTML
<%@ Control Language="C#" AutoEventWireup="false" CodeBehind="TestForm2.ascx.cs" Inherits="Durthaler.Modules.FirstDALMVC.TestForm2" %>
<%--<%@ Register TagPrefix="dnn" Namespace="DotNetNuke.Web.Client.ClientResourceManagement" Assembly="DotNetNuke.Web.Client" %>
<dnn:DnnJsInclude runat="server" FilePath="/DesktopModules/MVC/FirstDALMVC/resources/javascript/settings.js" />
<dnn:DnnJsInclude runat="server" FilePath="/DesktopModules/MVC/FirstDALMVC/resources/javascript/common.js" />--%>
<script type="text/javascript" src="<%=ResolveUrl("~/DesktopModules/MVC/FirstDALMVC/resources/javascript/settings.js") %>"></script>
<div class="container">
<h6>Supress Columns</h6>
<div>
<div class="row">
<label for="chkDetails" class="col-md-1">Details</label>
<input id="chkDetails" type="checkbox" class="col-md-1" />
<label for="chkPartNum" class="col-md-1">Part #</label>
<input id="chkPartNum" type="checkbox" class="col-md-1" />
<label for="chkCommercialPartNum" class="col-md-1">Commercial Part #</label>
<input id="chkCommercialPartNum" type="checkbox" class="col-md-1"/>
<label for="chkVendor" class="col-md-1">Vendor</label>
<input id="chkVendor" type="checkbox" class="col-md-1" />
<label for="chkQuantity" class="col-md-1">Quantity</label>
<input id="chkQuantity" type="checkbox" class="col-md-1" />
<label for="chkAvailableStock" class="col-md-1">Available Stock</label>
<input id="chkAvailableStock" type="checkbox" class="col-md-1"/>
</div>
<div class="row">
<label for="chkUnitCost" class="col-md-1">Unit Cost</label>
<input id="chkUnitCost" type="checkbox" class="col-md-1"/>
<label for="chkSaleCost" class="col-md-1">Sale Cost</label>
<input id="chkSaleCost" type="checkbox" class="col-md-1"/>
<label for="chkExpediteFee" class="col-md-1">Expedite Fee</label>
<input id="chkExpediteFee" type="checkbox" class="col-md-1"/>
<label for="chkQuote" class="col-md-1">Quote</label>
<input id="chkQuote" type="checkbox" class="col-md-1"/>
<label for="chkOrder" class="col-md-1">Order</label>
<input id="chkOrder" type="checkbox" class="col-md-1"/>
</div>
</div>
<h6>Search Providers</h6>
<div class="row">
<div class="col-md-4">column 2</div>
<div class="col-md-4">column 3</div>
<div class="col-md-4">column 4</div>
</div>
</div>