Can not validate empty fields when using SCEditor (WYSIWYG BBCode)

A few days ago I installed SCEditor from http://www.sceditor.com/ on my website. Today I discovered that it causes problem to check if textarea is empty or not. When I submit form I always get alert "Form is empty" even if it's not empty. When I click on "Submit" button one more time, the alert doesn't show up again.

Can somebody help me? I wanted to post this question on sceditor website but it looks that noone is monitoring it anymore.

Thanks.

======================

<script type="text/javascript">
function checkform(form) {
if (form.section.value == "")
{alert("Form is empty");return false;}
</script>


<script src="/scripts/sce.js" type="text/javascript"></script>
<script>
$(function() {
$("textarea").sceditor({
plugins: 'bbcode',
toolbar: "bold,italic,underline,quote,bulletlist,emoticon,color,youtube|removeformat",
enablePasteFiltering:true,
style: "/css/sce.css"
});});
var bbcodes = ['s', 'sub', 'sup', 'font', 'size', 'list', 'ol', '*','table', 'tr', 'th',  'td', 'emoticon', 'horizontalrule',  'img', 'url', 'email','code', 'left', 'center', 'right', 'justify', 'rtl', 'ltr', 'hr'];
$.each(bbcodes, function(idx, bbcode) { $.sceditorBBCodePlugin.bbcode.remove(bbcode);});
</script>

<form action="save.php" method="post" name="forum" onSubmit="return(checkform(this));">
<textarea name="text"></textarea>
<input class="butt" type="submit" value="Save" />
</form>

Answers


if($(".sceditor-container iframe").contents().find("body").text() == ""){
alert("error");
}

Try this code to validate the bbcode,this is working for me


Ok your job is to be or not to be.

 jQuery('.table_container a.replay_comment').click ->
    a=jQuery(this)
    bbcode='[quote] repondre '+a.attr('data-user-name')+' : \n\n'  +a.attr('data-bbcode')+' [/quote] [hr]'
    jQuery('#comment_content').sceditor('instance').val(bbcode)

Need Your Help

Use rel attribute as anchor link

jquery html css anchor rel

I'm wondering is it's possible to use a rel attribute as an anchor link. For instance, the html would read as follows: