下面是一個代碼nicEdit textarea的默認值
<?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的,它顯示長度= 4。 爲什麼是這樣?是否有默認值的nicedit textarea?如果是的話,如何改變它?
這真的是原始碼嗎?我假設你在'textarea'標籤之間有一些空格字符... – CBroe 2013-04-09 08:45:48
不,標籤之間沒有一個空格。它是一個原始代碼。 – 2013-04-09 08:51:19