는 여기서, 길이 = 4를 보여주고 내가 nicedit 텍스트 영역에 텍스트를 입력하지 않고 양식을 제출하고 경우 코드nicEdit 텍스트 영역의 기본 값
<?php
if (isset($_POST['flag'])) {
$length=strlen(trim($_POST['area']));
echo "Length of abstract : ".$length;
if (!strlen(trim($_POST['area']))){
$abstractErrorMsg = "Please enter the abstract of your article";
echo $abstractErrorMsg;
}
}
?>
<form method="post" action="">
<input type="hidden" name="flag" value="hidden">
<script type="text/javascript" src="http://js.nicedit.com/nicEdit-latest.js"></script>
<script type="text/javascript">
//<![CDATA[
bkLib.onDomLoaded(function() {
nicEditors.editors.push(
new nicEditor().panelInstance(
document.getElementById('myNicEditor')
)
);
});
//]]>
</script>
* Abstract
<textarea name="area" id="myNicEditor" style="width: 300px;height: 100px;"></textarea>
<input type="submit" name="btn">
</form>
입니다. 왜 그런가요? nicedit textarea의 기본값이 있습니까? 예, 변경하려면 어떻게합니까?
이것은 실제로 원래 코드입니까? 'textarea' 태그 사이에 공백 문자가 있다고 가정합니다 ... – CBroe
태그 사이에 공백이 하나도 없습니다. 원본 코드입니다. –