15
How to check CKEditor textarea not empty
How to check CKEditor 4 textarea not empty
<div class="ckarea" style="display:none;">Please enter Description</div>
<textarea name="longdesc" id="longdesc"></textarea>
<script>
CKEDITOR.replace( 'longdesc' );
</script>
<script>
$("form").submit(function(e) {
var description = CKEDITOR.instances['longdesc'].getData().replace(/<[^>]*>/gi, '').length;
if (!description) {
$(".ckarea").show();
return false;
}
});
</script>
rated 15 times
(15)
(0)
comments: 0 / hits: 4306
/ 4 years ago, sun, dec 25, 16, 02:44:24
More From
» JavaScript
Comments
There are no comments for this Snippet yet
Only authorized users can post. Please sign in first, or register a free account