I am trying to disable some input fields using jQuery 1.4.2. This is a part of the HTML code:
<input type="text" disabled="disabled" name="nume" value="Text" />
This is the Javascript:
$('.salveaza').live('click', function(e){
$.get(ajaxURL, $('form', itemCurent).serialize()+'&id='+itemCurent.data('id')+'&optiune=editeaza-categorie');
// This is the code for disabeling inputs
$('input', itemCurent).attr('disabled', 'disabled');
itemCurent.removeClass('curent');
$('.optiuniEditeaza', itemCurent).remove();
e.preventDefault();
});
The above code doesn't work. Note that the inputs are added with jQuery, that's why I am using live, I tried all sorts of stuff.
I also tried firebug console to disable all input fields on the page and it's not working:
$('input').attr('disabled', 'disabled');
Any help will be apreciated, Thanks
inputelement, as long as theinputis a child ofitemCurent. Are you certain that the code after your$.get()is running? Does the request succeed?