Here is the 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 submit a form without entering any text in nicedit textarea, it shows length = 4. Why is this so? Is there a default value for nicedit textarea? If so, how to change it?
source share