CKeditor文本区域有值(PHP)(验证)

时间:2015-03-23 07:01:33

标签: javascript php validation

嗯,我是这件事的新手。我有一个问题是验证ckeditor。验证文本字段和普通文本区域是否正常工作。我希望你们能帮忙。 对不起,我在这件事上很认真了

这是我要验证的地方

$msg = array();
//$varSubmitSucces=true;


if(empty($_POST['thesis_title'])) $msg[] = "<div class=\"error\"><span>Please insert Thesis Title</span></div>";
if(empty($_POST['introduction']) || $_POST['introduction'] == "/^\s*$/")
$msg[] = "<div class=\"error\"><span>Please insert Introduction</span></div>";
if(empty($_POST['objective'])) $msg[] = "<div class=\"error\"><span>Please insert objective</span></div>";
if(empty($_POST['description'])) $msg[] = "<div class=\"error\"><span>Please insert Description</span></div>";
if($_POST['jobs1_area'] == "") $msg[] = "<div class=\"error\"><span>Please select Thesis Area</span></div>";
//print_r();
//print_r($msg);
//exit();      if(empty($msg)) 
{


`<?php if(!empty($msg)) {
    foreach($msg as $err) {
        echo $err;
    }
}?>`

$(document).ready(function() {         

    $('.error').hide();
    var showError = <?php echo $msg; ?>;         
    if (showError) {             
        $('.error').fadeIn(500).delay(5000).fadeOut(500);
        alert("introduction: " + document.form1.introduction.value);
        $msg.focus();       
    } else {

    }

});

0 个答案:

没有答案