Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jQuery: removeAttr("disabled") not working on Firefox

I have some code that looks like the following coming back from an XHR response:

jQuery(':text:not(:hidden)').removeAttr("disabled");

This is a result of input fields being disabled after form submit. The XHR response returns this tidbit of jQuery and re-enables controls. Works great on every browser, even "partially" on FF 3.6.1 OSX. What I mean by partially is that some text fields have the disabled attribute removed, others do not. These text fields are verified not hidden.

like image 602
randombits Avatar asked Nov 09 '10 21:11

randombits


1 Answers

Have a go using this instead:

jQuery('input:text:visible').each(function(){
    this.disabled = false;
});

This uses the disabled property of the element directly, rather than messing around with jQuery wrappers.

like image 135
lonesomeday Avatar answered Sep 23 '22 18:09

lonesomeday