Submit Button Only Working on Page Refresh

I had an interesting problem today.  A submit button in a form wasn’t working – unless I reloaded the page.  I spent some time researching and found a few answers – for one person they hadn’t closed a tag properly. Someone else suggested it had something to do with turbolinks.  Another answer said that the submit button needed to be nested within the form. Here was the original code:

submit button not workingI checked the page source, and indeed, the submit button was within the form tags.

As it turns out, the div has an effect. The submit button is within a separate div, within the form tags.  When I changed the code to what’s below, it started working.

submit button working




Leave a Reply

Your email address will not be published. Required fields are marked *