I've been stuck for a while, and I can't find a way to solve this problem.
I want to make a enable a <select>
onClick button, but it doesn't work :
<div class="col-lg-12">
<div class="form-group" style="overflow-y: scroll; height: auto; max-height: 545px;">
<asp:Repeater ID="RepeaterCorrection" runat="server">
<ItemTemplate>
<label>
<asp:Literal ID="litCorLibelle" runat="server" Text='<%# Eval("DESCRIPTION")%>'></asp:Literal>
</label>
<asp:DropDownList ID="ddlCorChamp" runat="server" CssClass="form-control selectpicker"
data-live-search="true"></asp:DropDownList>
<asp:RequiredFieldValidator ID="rfvDropDownList" ForeColor="Red" Display="Dynamic" runat="server"
ErrorMessage="Don't forget that field" ControlToValidate="ddlCorChamp"
InitialValue="Select something" />
<p class="help-block"></p>
<asp:HiddenField ID="hiddenCorIdChamp" runat="server" Value='<%# Eval("IDCHAMP") %>' />
<asp:HiddenField ID="hiddenCorNameChamp" runat="server" Value='<%# Eval("NAMECHAMP")%>' />
<asp:HiddenField ID="hiddenCorType" runat="server" Value='<%# Eval("TYPE")%>' />
</ItemTemplate>
</asp:Repeater>
</div>
<asp:Button ID="btnValid" runat="server" Text="Let's Enable this !"
class="btn btn-primary btn-block" CausesValidation="False" UseSubmitBehavior="False" Enabled="True" />
</div>
//IT WORKS, IT IS DISABLED
$('Select[Champ=ID_REJECT]').prop('disabled', true);
//IT DOESN'T WORK, IT IS STILL DISABLED, EVEN WHEN I CLICK
$('#<%= btnValid.ClientID %>').click(function () {
$('Select[Champ=ID_REJECT]').prop('disabled', false);
//$('Select[Champ=ID_REJET]').removeAttr("disabled");
//$('Select[Champ=ID_REJECT]').attr('disabled', false);
return false;
});
I really don't get it why... Do you have any idea ?