We are using jquery-1.7.1 and are trying to hide a button in asp.net. The button is a linkbutton control. The code we are using is as follows
function checkDisabledButton(btn){
var mbtn = $('#' + btn)
mbtn.prop('disabled', true);
};
the button gets disabled in IE but Chrome and Firefox is does not get disabled. I've seen a lot of post about it.. but most of those talk about needing jQuery 1.7.. which we are already using. Was hoping someone could lend a hand.
After looking at the reponses I've been looking into changing to a asp:button which gets rendered as an input type=submit. What i really want is to be able to call a function to do the disable of the control. In that way i can use the same function for multipal buttons and multipal pages. I've still not got it working, but with that in mind.. I was hoping someone could continue with the help. Here is the button control being called
<asp:Button ID="lbApprove" runat="server" CssClass="ButtonPrimary button" Text="Approve" OnClientClick="return tryIt(this, 'PROCESSING');"/>
The tryIt changes the text of the button once clicked to whatever i pass in (in this case 'PROCESSING'). Again.. i want the button to only be clickable once. I've looked at the .one and also the .on and .off but haven't had any luck just yet. I am not posting any code at this point as it's just try's so far...
Here is the latest and at first attempt appears to work. It's not jQuery.. but might be a start. It disables the button before page postback happens. It comes from this article. Got to have a starting point right :)
http://aspsnippets.com/Articles/Disable-Button-before-Page-PostBack-in-ASP.Net.aspx