Disabled button still listens to click event

前端 未结 8 2600
感动是毒
感动是毒 2021-02-19 04:53

I have a problem in a form where I do some jquery validations. If a specific input field is not filled out, it should disable a \"step forward\" button by adding a disabled attr

相关标签:
8条回答
  • I am too late by too many year :P Still if someone can get help out of my answer: HTML :

    <button type="button" id="verifyBtn" class="disabled" onClick="submitForm(this);"></button>
    

    JS:

    • To enable

      $j('#verifyBtn').addClass('disabled');

      $j('#verifyBtn').attr('disabled','disabled');

    • To disable

      $j('#verifyBtn').removeClass('disabled');

      $j('#verifyBtn').removeAttr('disabled','disabled');

    0 讨论(0)
  • 2021-02-19 05:26

    Please off the click event

    $('.btn-move-forward').off('click');
    
    0 讨论(0)
提交回复
热议问题