How Form Validation Navigates to Unfilled Options

  We often use form validation when doing data submission. If there is an option to fill in the form element , the form submission is generally prohibited.

  If the form needs to verify a lot of data, some required fields are empty and cannot be submitted, but the position of the unfilled item is not located, causing the user to be confused and do not know why it cannot be submitted.

  At this time, we can add foucs() to the unfilled form items

  For example, the code in the picture above, so that the cursor can be positioned to the unfilled item

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324715345&siteId=291194637