having problems with .prop("disabled", false) it's works fine in opera and firefox but IE and chrome i can't get it to work..
Actualy it's a invination form and im make send button like this
<input id="sendInvite" class="mail_send" disabled="disabled" type="button" name="invite" value="Send">
and here is css
.mail_send[disabled="disabled"] {background-color:#343434; color:#747474}
So as you can see button is disabled and you can't click, you must first write your name and mail after that button is remove disabled and you can send mail. For this im write code here is: http://pastebin.com/8u23G90b
But something is wrong here, in chrome and IE disabled never removed from button, im also load jquery 1.7.1
p.s sorry for my english
An element can be disabled in HTML by setting disable property to true and enabled again by setting disabled=false. By using jQuery, you can grab the element you want to enable or disable and change this property by using the prop() or attr() function, depending upon the version of jQuery you are using.
We can easily disable input box(textbox,textarea) using disable attribute to “disabled”. $('elementname'). attr('disabled','disabled'); To enable disabled element we need to remove “disabled” attribute from this element.
document. getElementById('element-name'). disabled=false; was what I was looking for. Thanks!
You can use $(":disabled") to select all disabled items in the current context. To determine whether a single item is disabled you can use $("#textbox1").is(":disabled") . Save this answer.
Remove the attribute:
$('button').removeAttr("disabled");
See .removeAttr() for more details
Your problem is not with JQuery, but with your CSS selectors. The disabled attribute is referring to the default value when the page first loads, rather than whether the element is actually disabled or not.
The CSS selector you want is the :disabled selector:
.mail_send:disabled {background-color:#343434; color:#747474}
You can see an example with this jsfiddle.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With