Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

299
Visualizações
How can we disable a .NET WebForms (.aspx file) LinkButton in Google Chrome

I need to disable a LinkButton in a .aspx file using jQuery depending on the value. The button gets disabled in IE 8. But in Google Chrome it is not disabled.

Code:

$(".grid-prev-btn").addClass('ui-state-disabled').attr('disabled', true);

Please give me solution for this issue

I am trying to disable link button for a particular condition it gets disabled in Internet Explorer but in Chrome browser it not getting disabled

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

ok, really you should be using prop instead of attr for recent implementations of jQuery

$(".grid-prev-btn").addClass('ui-state-disabled').prop('disabled', true);

attr would be more applicable to the written disabled="disabled" attribute on a tag, so should more correctly be .attr("disabled", "disabled")

However, disabled on hyperlinks isn't supported on modern browsers, so I'd suggest the following. The .attr, disabling pointer-events and adding a click handler for should the link be triggered by the keyboard

As you are using jQuery 1.8.x, I would recommend the full solution as follows.

$(".grid-prev-btn").addClass('ui-state-disabled').attr('disabled', 'disabled').css('pointer-events', 'none').on("click", function() { return false; });

You could of course remove the pointer-events bit from inline, and put it in your CSS for .ui-state-disabled

a.ui-state-disabled { pointer-events: none; }
about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda