﻿function checkccsubject(control) {
    if (control.value == "") {
        validatePrompt(control, "請輸入留言標題！");
        return (false);
    } else
        return (true);
}

function checkccmessage(control) {
    if (control.value == "") {
        validatePrompt(control, "請輸入留言內容！");
        return (false);
    } else
        return (true);
}

function validateall(form) {
    if (!checkccsubject(form.cctitle)) return(false);
    if (!checkccmessage(form.ccmessage)) return(false);
    form.submit();
}

function validatePrompt(control, promptStr) {
    alert(promptStr);
    control.focus();
    return;
}
