Here is a code
<?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>
If i am submitting form without entering any text to nicedit textarea, it is showing length=4. Why it is so?Is there any default value of nicedit textarea ? If yes,how to change it?