Javascript select onchange='this.form.submit()'

前端 未结 6 1105
忘了有多久
忘了有多久 2020-12-01 05:42

I have a form with a select and a few text inputs. I\'d like the form to be submitted when the select is changed. This works fine using the following:

onchan         


        
6条回答
  •  萌比男神i
    2020-12-01 05:56

    My psychic debugging skills tell me that your submit button is named submit.
    Therefore, form.submit refers to the button rather than the method.

    Rename the button to something else so that form.submit refers to the method again.

提交回复
热议问题