0

i have a problem when attemp put this Bootstrap "tooltip" into a conditional, the problem is that not show it. I show you my code:

$(document).ready(function () {
$("._diifem_").prop("disabled", true);
$('#wall').on('keyup', function () {
    var textarea_value = $("#wall").val();
    if (textarea_value.length > 5) {
        $('._diifem_').prop({
            disabled: false,
        });
    } else {
        $('._diifem_').prop({
            disabled: true
        }).tooltip({
            title: 'Hola',
            trigger: "click"
        });
    }
  })
});

The class "._diiefem" = Button that will be hidden. The ID "#wall" = textarea

what am I doing wrong? :(

Thanks everyone :3

Alex Parra
  • 61
  • 3

1 Answers1

0

Look at the accepted answer of this question. Disabled buttons don't fire of any DOM events, I suspect that's why you're experiencing issues.

Check out some of the other answers to that question for possible workarounds. I think you'd probably be best off by faking a disabled button using the .disabled css class in Bootstrap.

Community
  • 1
  • 1
bmceldowney
  • 2,307
  • 13
  • 19