“Invalid form control” only in Google Chrome

前端 未结 13 1675
感情败类
感情败类 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条回答
  •  Happy的楠姐
    2020-11-29 04:17

    I have to do something like this to fix the bug, since I have some type="number" with min="0.00000001":

    HTML:

    
    

    JS:

    $('input[type="submit"]').click(function(e) {
        //prevent chrome bug
        $("input:hidden").val(null);
    });
    

    If I don't set all hidden input field to null chrome will still try to validate the input.

提交回复
热议问题