Skip to main content

Bootstrap 4 modal form in rails disables submit button on ajax refresh

Rails • Asked by nynhex

I've been struggling with this all day. Please see the link below.

Bootstrap 4 modal form in rails disables submit button on ajax refresh

I've tried removing turbolinks, attempting to user jquery-turbolinks but there's no compatibility, and writing JS to try to fix this but to no avail.

Summary:

Modal is fired when you click on "notes" for a call object. Modal pops up and you enter a note and it does a regular html submit and posts the note, refreshing the page. An ajax request refreshes the partials every 15s, after the refresh happens if you hit "notes" again it will pop up, you can enter text, but the submit/create button does nothing when you click it.

No errors in the js console and nothing in the development.log. It only starts working again when you do a page reload.

I had similar functionality in an older Rails 3.2 and 4.2 app with bootstrap 2.x and 3.x and had no problems. But moving to Rails 5.1, Bootstrap alpha 4 v6 gives me no joy.

My first born cat to the talented person who can help me debug this :)


Figured this out, see SO for the details. It was an HTML issue. Resolved :)


Login or Create An Account to join the conversation.

Subscribe to the newsletter

Join 24,647+ developers who get early access to new screencasts, articles, guides, updates, and more.

    By clicking this button, you agree to the GoRails Terms of Service and Privacy Policy.

    More of a social being? We're also on Twitter and YouTube.