[Java] How to enable submit button every time with jquery

less than 1 minute read

What I learned while learning JavaScript at Tech Camp

After learning asynchronous communication using jQuery, press the submit button and after the event fires
Here’s how to enable the submit button to be disabled.

$('#hoge').prop('disabled', false);

What I found after investigating

–Disabled is set by default in Rails ver5.0 or later (to prevent repeated hits, etc.)
――There are other methods that can be effective

For example

$('#hoge').attr('disabled', false);

I tried it with my code and both worked

Next time, I will investigate methods such as prevention of repeated hits and make it usable

When asynchronous communication can be handled freely, many dynamic elements can be created in a small number of view files.
I can take it in and the response seems to be quick, so even myself who has just learned programming
I felt it was attractive.

Difficult but interesting