“Invalid form control” only in Google Chrome

前端 未结 13 1692
感情败类
感情败类 2020-11-29 03:32

The code below works well in Safari but in Chrome and Firefox the form will not submit. Chrome console logs the error An invalid form control with name=\'\' is not fo

13条回答
  •  谎友^
    谎友^ (楼主)
    2020-11-29 04:30

    I had this issue when I had class="hidden" on the input fields because I was using buttons instead of radio bullets - and changing the "active" state via JS..

    I simply added an extra radio input field part of the same group where i wanted the msg to appear:

    
    

    the other 2 active bullets are invisible, this one isnt and this triggers the validation message and no console errors - bit of a hack but what isnt these days..

提交回复
热议问题