Rails Trying to submit a form onchange of dropdown

后端 未结 11 1290
遥遥无期
遥遥无期 2020-12-13 20:28

I have my Ajax working, builtin Rails javascript, with the submit button. However, I would like it to submit when I change the value of the dropdown box and eliminate the b

11条回答
  •  悲哀的现实
    2020-12-13 21:14

    Depending on the js library you are using:

    Prototype: :onchange => ("$('switch_car').submit()")

    Jquery: :onchange => ("$('#switch_car').submit()")

    If you are using the defaults and your rails version is below 3.1, then prototype is the default library.

提交回复
热议问题