Rails remote form and select on change not working

前端 未结 3 775
迷失自我
迷失自我 2021-01-18 11:55

I was trying to follow: Rails: submit (via AJAX) when drop-down option clicked

However none of these options appear to work (onsubmit, submit)

This is what I

3条回答
  •  隐瞒了意图╮
    2021-01-18 12:25

    Although rails overrides the default action and submits via AJAX when you add :remote => true, you are forcing the form to post the regular what in your onchange event.

    You need to make your own function to submit via AJAX and call that from your onchange, using $.post() $.post() to send the form to the server.

提交回复
热议问题