Is there a way to disable all buttons within a specific class? I have attempted the following code without success:
$("input.myClass").attr('disabled', true);
This is how I am trying to implement it:
<script type="text/javascript>
$(document).ready(function() {
var objA = $get('<%= checkbox.ClientID %>');
$(objA).change(function() {
if($(this).is(':checked'))
{
$(".anotherClass").sortable('disable'); //works
$("input.myClass").prop('disabled', 'disabled'); //doesn't work
}
The CSS styling for this class is straightforward:
.myClass
{
float: left;
width: 140px;
margin-left: 4px;
margin-right: 4px;
padding-top: 20px;
text-align: center;
}
Here is an example of the HTML structure:
<div class="myClass">
<asp:Button ID="btn1" Text="bbb" runat="server" CausesValidation="False" CssClass="button" OnClientClick="return false;" />
<asp:Button ID="btn2" Text="aaa" runat="server" CausesValidation="False" CssClass="button" OnClientClick="return false;" />
<asp:Button ID="btn3" runat="server" CausesValidation="False" CssClass="button" OnClick="bt_Click" />
</div>