Input Validation Check

Zoey·2021년 4월 8일
0

Building Website

목록 보기
1/1

Is 'input validation' not working?

Check these 3 things before getting so frustrated.
So simple!

  1. Have you put 'required' inside of 'input'?
    P.S. Please don't forget to close the tag!
  2. Make sure that you include "submit" type for 'button' or 'input' tags.
  3. Have you put everything inside 'form' tag?
    Even 'button' should be inside of it.

Let me give you an example which explains all those things.

<form>
  <div>
    <label for="id">ID</label>
    <input id="id" required />
  </div>
  <div>
    <label for="password">ID</label>
    <input id="password" required />
  </div>
  <button type="submit">Submit</button>
</form>

These should solve most of problems!
Hope it's been helpful.
See ya! :)

0개의 댓글