Rails data-disable-with re-enabling button

前端 未结 4 1026
情深已故
情深已故 2021-01-31 03:32

I have a Rails Devise form that has javascript validation. When the user presses submit, the validation works and the user is refocused on the form where they need to be.

4条回答
  •  余生分开走
    2021-01-31 04:00

    I managed to solve this quite simply. I just went in and removed the data-disable-with from the button with the code:

        $('#my-button').removeAttr('data-disable-with');
    

    And then re-establishing the attribute when the form was ready to be submitted to prevent double clicks from creating duplicates.

提交回复
热议问题