An invalid form control with name='' is not focusable. WITHOUT ANY REQUIRED OR HIDDEN INPUTS

后端 未结 8 944
一整个雨季
一整个雨季 2020-12-11 01:40

I\'m facing the well known Chrome\'s \"not-focusable-input\" error but my situation is different from the explained in the other post I could find there.

I have thi

8条回答
  •  南笙
    南笙 (楼主)
    2020-12-11 02:32

    Thanks to this post, I saw that my problem also rested with Chrome trying to focus on my fieldsets, instead of the input field.

    To get a better response from the console:

    • Assign every DOM element a new name
    • Set every input & select style.display to 'block'
    • Changed the type of input[type="hidden"] elements to 'text'

      function cleanInputs(){
          var inputs  = document.getElementsByTagName( 'input' ),
              selects = document.getElementsByTagName( 'select' ),
              all     = document.getElementsByTagName( '*' );
          for( var i=0, x=all.length; i

    In the console, I ran cleanInputs() and then submitted the form. The result, from the console, was:

    An invalid form control with name='28_test' is not focusable.

    An invalid form control with name='103_test' is not focusable.

    Then, switching over to the Web Developer "Elements" view, I was able to find "28_test" and "103_test" (both fieldsets) -- confirming that my problem was a required input field, nested inside a fieldset.

提交回复
热议问题