알러트 동작 문제

알러트 동작 문제

QA

알러트 동작 문제

본문


 
<form name="wp" id="wp" method="post" action="./pointupdate.php" autocomplete="off">
    <ul class="point_all">
        <li class="full_li">
            보유포인트
            <span><?php echo number_format($member['mb_point']); ?></span>
        </li>
        <li class="full_li">
        <div>
            <label for="w_point">신청 포인트</label>
            <div style="float:right;">
                <input type="text" name="w_point" id="w_point" size="15" placeholder="0"> 점
            </div>
        </div>
        </li>
    </ul>
    <input type="submit" name="act_button" value="신청" onclick="forderform_check(this.form);" class="btn_close" style="background:#ebebeb;">
</form>
<script>
function wp(f) {
    if (f.w_point.value)
    {
        temp_point = parseInt(f.w_point.value);
        if (temp_point < 0) {
            alert("포인트를 0 이상 입력하세요.");
            f.w_point.select();
            return false;
        }
        if (temp_point > <?php echo (int)$member['mb_point']; ?>) {
            alert("회원님의 포인트보다 많이 신청할 수 없습니다.");
            f.w_point.select();
            return false;
        }
    }
}
</script>

 

이렇게 코드를 짰는데요 알러트 부분이 정상동작하지 않아요

 

뭐가 문제일까요?

이 질문에 댓글 쓰기 :

답변 1

form 어디에도 함수 wp를 실행시키는게 없네요

해당 함수wp에 든 내용을 forderform_check에 넣어야 할것같네요

답변을 작성하시기 전에 로그인 해주세요.
전체 267
QA 내용 검색

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1404호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT