발생하고 있던 문제 :

Button type = "submit" 으로 버튼 이벤트를 주다보니 다른 페이지로 이동해버리는 문제가 발생

 

 

[ 해결 완료 ]

 

이전 블로그에서는 다른 팝업창을 띄워서 그 곳에서 인증하는 방식으로 해결한다고 말했었습니다.

하지만 더 간단하고 쉬운 방법을 찾았습니다.

 

<form th:action="@{/member/emailConfirm}" method="post" target="param">
            <div>
                <h3 class="join_title"><label for="email">이메일</label></h3>
                <span class="box int_email">
                        <input type="text" name="email" id="email"
                               class="form-control" maxlength="100">
                    </span>
            </div>

            <!-- 이메일 인증 번호 요청 버튼 -->
            <input type="submit"
                   value="인증번호받기"
                    id="email-btn"
            />
</form>
<iframe id="if" name="param"></iframe>

위와 같이 iframe 을 활용하여 간단하게 해결할 수 있었습니다.

 

iframe 에 대한 설명은 아래의 글이 잘 적혀있어 읽어보시고 활용하면 좋을것 같습니다.

 

https://yeoulcoding.me/143

 

[HTML] iframe 태그란?

Definition iframe이란 Inline Frame 의 약자로, 웹 브라우저 내에 또 다른 프레임, 즉 현재 브라우저에 렌더링되고 있는 문서 안에 또 다른 HTML페이지를 삽입할 수 있도록 하는 기능을 제공합니다. 검색

yeoulcoding.me

 

+ Recent posts