Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

292
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!