//================================================
// 메일 발송전 폼 체크
// 2009-11-06
// kdonghwa
//================================================
function formCheck() {
    if (jQuery('#fromMail').val().length == 0) {
        alert('발송 메일 주소를 적어주세요');
        jQuery('#fromMail').focus();
        return false;
    }
    if (jQuery('#title').val().length == 0) {
        alert('메일 제목을 적어주세요');
        jQuery('#title').focus();
        return false;
    }
    if (jQuery('#content').val().length == 0) {
        alert('메일 내용을 적어주세요');
        jQuery('#content').focus();
        return false;
    }
    return true;
}

//================================================
// 메일 발송Ajax
// 2009-11-06
// kdonghwa
//================================================
function sendMail() {
    var options = {
        beforeSubmit: formCheck,
        success: responseCtl,
        url: "/url.do",
        contentType: "application/x-www-form-urlencoded;charset=UTF-8",
        type: "post", /* get, post */
        dataType: "html" /* xml, html, script, json */
    };
    jQuery("#fmMailInfo").ajaxSubmit(options);
}

//================================================
// 메일 발송결과 처리
// 2009-11-06
// kdonghwa
//================================================
function responseCtl(html, status) {
    if (status == 'success') {
        alert('메일을 발송하였습니다.');
        self.close();
    }
    else {
        alert('메일 발송에 실패하였습니다!');
    }
}



+ Recent posts