javascript - How to remove the attribute "disabled" from input siblings when i click on a submit input -


i have problem: need remove "disabled" attibute siblings inputs of submit input. here html:

<td> <input type="hidden" value="2000000000002_statuto_07_10_2010.gif" name="nomedocumento" disabled="true"> <input type="hidden" value="811ecdd0-65e9-49d6-8d9d-8b7c9d9b6407" name="uuid" disabled="true">    <input type="submit" value="cancella" name="cancella"> </td> 

i need simple way using jquery remove disable attribute when click on submit. tried:

$('input[name=cancella]').click(function(){ $('this').prev().removeattr('disabled'); $('this').prev().prev().removeattr('disabled'); } 

but doesn't work.

any suggestion?

$('input[name=cancella]').click(function(){    $(this)       .closest('td')       .find('input[name!='+this.name+']')       .attr('disabled', false); }); 

fabrizio calderan .prevall() way better. however, .siblings() better, doesn't matter siblings are.

$('input[name=cancella]').click(function(){    $(this).siblings('input').attr('disabled', false); }); 

using .attr('disabled', false) should work , more reliable.


Comments

Popular posts from this blog

ASP.NET/SQL find the element ID and update database -

jquery - appear modal windows bottom -

c++ - Compiling static TagLib 1.6.3 libraries for Windows -