프론트 작업을 하다보면, form 태그들은 유효성 검사가 늘 따라붙는다.
유저가 유효한 값을 매번 잘 작성하리라고 기대할 수 없기 때문이다.
이름은 고유명사이고 정해진 틀이 없어서 유효성 검사할 게 없을 거 같았는데,
찾아보니 제법 내용이 있다.
text.replace(/[^가-힣a-zA-Z]/g, replaceText);
$("input[name='counselName']").val === ""
$("input[name='counselName']").val.length < 2
참고사이트
https://estar.tistory.com/76
https://sesok808.tistory.com/325