. Advertisement .
..3..
. Advertisement .
..4..
I get the “an invalid form control with name=” is not focusable” issue when trying to try to submit a form for some customers can proceed to my payment page. Here is the detail of the error I got the error message:
An invalid form control with name='' is not focusable
Please give me some advice to solve this problem.
The cause:
For the two reasons listed below, a form control could not be focusable after validation is initiated:
-As shown in the business logic’s present context, the field is irrelevant. The appropriate control should either be disabled in such a case, deleted from the DOM, or not tagged with the
required
at that time.-By hitting the ENTER key on an input, a user may trigger premature validation. Or a user may click on a button or input control on a form that has an incorrect
type
attribute definition. The default value of a button’stype
property issubmit
, thus if the type attribute is not changed tobutton
, Chrome runs a validation each time the button is pressed.Solution: If your page has a button that performs something other than submit or reset, always consider doing the following to fix the error “an invalid form control with name=” is not focusable”:
The
novalidate
attribute can be added to the form.