Error trying to validate field with required="required"

Asked

Viewed 192 times

0

I am trying to validate my fields with required="required", in various modals, it turns out that the page, has tabs, and when I try to use the required="required", nor does the modal open(remembering that the fields I need validation, are textbox, and dropdownlist), appears the following error:

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

From what I understand, he’s trying to validate the hidden elements. I needed it to validate the elements of the modal that is open, and not of all the elements at once. I did a lot of research on the subject, tried several alternatives, one of them was this code in the form that didn’t work:

<form name="myform" novalidate>

How can I validate the field in a modal with required ? All modes I found that say work, did not work.

  • 1

    Please place the code snippet with the lines that the browser accuses the error

  • If you are using more than one form on the page, give a different name and id for each and test.

  • How so name and id differentiated ? did not understand.

  • This happened to me yesterday. It was an open form that I had forgotten. It is good also to check if we have not forgotten some open TAG. A div, form, etc ...

1 answer

0


Browser other questions tagged

You are not signed in. Login or sign up in order to post.