Robert Reiz


20 Experience
0 Lessons Completed
0 Questions Solved


My pragmatic solution for right is this:

<%= f.submit :class => "btn btn-primary brndc", 
           :value => t('general.btn_update'),
           :onclick => "this.form.submit(); this.disabled=true; this.value='Sending…';" %>

I exactly followed the example, but it doesn't work for me. The form is submitted but the button is not disabled and the text is not changing. Do I miss some JS magic? Any ideas?

Screencast tutorials to help you learn Ruby on Rails, Javascript, Hotwire, Turbo, Stimulus.js, PostgreSQL, MySQL, Ubuntu, and more.

© 2024 GoRails, LLC. All rights reserved.