cannot create a session after the response has been committed
@PostMapping("/auth/joinProc")
public String joinProc(@ModelAttribute @Valid MemberDto.RequestDto memberDto, BindingResult bindingResult, Model model) {
is not a function at HTMLInputElement.onblur
<div class="input-group input-group-static mb-4">
<label th:for="chkPassword">비밀번호 확인</label>
<input class="form-control" type="password" th:id="chkPassword"
placeholder="비밀번호" onblur="checkPassword()">
<span id="passwordResult"></span>
</div>
<script>
/** 비밀번호 확인 **/
function checkPassword(){
const password = $('#chkPassword').val();
const chkPassword = $('#password').val();
const passwordResult = document.querySelector('#passwordResult');
if(password == chkPassword){
if(password == ""){
passwordResult.style.color = 'red';
passwordResult.innerHTML = '비밀번호를 입력해주세요.'
} else {
passwordResult.style.color = 'green';
passwordResult.innerHTML = '비밀번호가 일치합니다.'
}
} else {
passwordResult.style.color = 'red';
passwordResult.innerHTML = '비밀번호가 일치하지 않습니다.'
}
}
</script>
id 값과 함수명을 동일하게 설정해서 만든 에러였다.
id값과 함수명을 다르게 설정해주었다.