Firefox won't submit a form created by JavaScript

前端 未结 2 1222
庸人自扰
庸人自扰 2021-01-11 10:19

I need to create a form with a few inputs when an event happens. My code is below.

Chrome submits fine - the alert box shows and the page changes.

Firefox do

2条回答
  •  臣服心动
    2021-01-11 10:54

    FF requires it to be in the DOM already. Set form to display:none and add it to an existing element in DOM and then submit it.

提交回复
热议问题