Jquery ui button disable problem

Hi

Im building a pagination with php jquery and ajax.

this is the code im using to disable buttons which has inactive class

$("#toolbar").find(".inactive").button({ disabled: true });

Open in new window


it works fine in firefox but IE shows button as disabled but if i click on disabled button, it still works

any idea why? How to fix this?


Regards.
LVL 3
3xtr3m3dAsked:
Who is Participating?
 
BurniePCommented:
Hi,

Take a look at this thread : http://stackoverflow.com/questions/3112541/disable-button-working-on-click

It looks like your button is a submit button, and IE will still submit even if disabled.

So you need to verify in the click event of that button, if it is disabled, then return false.

0
 
Lukasz ChmielewskiCommented:
And:
$("#toolbar").find(".inactive").button.attr('disabled',true); 

Open in new window

?
0
 
3xtr3m3dAuthor Commented:
that line makes button disabled. but on IE it appears as disabled but its still works
0
 
Lukasz ChmielewskiCommented:
try this then:
$("#toolbar").find(".inactive").button({ disabled: true }).click(function(e){e.preventDefault();});
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.