English 中文(简体)
TinyMCE j 证据确认
原标题:TinyMCE jQuery validation issue

我用简单的锡里卡马利语播放我的网页。 当我用 j子鉴定我的文字区域时,就出现了问题。

页: 1 证言的确证实了我的文本领域。

  1. Still save the empty text
  2. Mentioned (". Don t leave the Text area Empty") Error occued when write some thing in the TextArea.

www.un.org/Depts/DGACM/index_spanish.htm 这是我的法典:。

<------------------------------------------------------->
jQuery code:
<------------------------------------------------------->
<script type="text/javascript">
$(document).ready(function() {
    $("#frmeditpages").validate({
        rules: {
            txtdescription:
            {
                required:true
            }

                },
        messages: {
            txtdescription: ".       Don t leave the Text area Empty"

                  }
    });
});
</script>
<----------------------------------------------------------->
<!-- TinyMCE -->
<----------------------------------------------------------->

<script type="text/javascript" src="../js/jquery-lib.js"></script>  
<script type="text/javascript" src="../js/jquery.validate.js"></script>
<script type="text/javascript" src="../tinymce/jscripts/tiny_mce/tiny_mce.js"></script>

<script type="text/javascript">
    tinyMCE.init({
        // General options
        mode : "textareas",
        theme : "simple",
        plugins : "pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,wordcount,advlist,autosave",

        // Theme options
        theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect,fontselect,fontsizeselect",
        theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor",
        theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen",
        theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,pagebreak,restoredraft",
        theme_advanced_toolbar_location : "top",
        theme_advanced_toolbar_align : "left",
        theme_advanced_statusbar_location : "bottom",
        theme_advanced_resizing : true,

        // Example content CSS (should be your site CSS)
        content_css : "css/content.css",

        // Drop lists for link/image/media/template dialogs
        template_external_list_url : "lists/template_list.js",
        external_link_list_url : "lists/link_list.js",
        external_image_list_url : "lists/image_list.js",
        media_external_list_url : "lists/media_list.js",

        // Style formats
        style_formats : [
            {title :  Bold text , inline :  b },
            {title :  Red text , inline :  span , styles : {color :  #ff0000 }},
            {title :  Red header , block :  h1 , styles : {color :  #ff0000 }},
            {title :  Example 1 , inline :  span , classes :  example1 },
            {title :  Example 2 , inline :  span , classes :  example2 },
            {title :  Table styles },
            {title :  Table row 1 , selector :  tr , classes :  tablerow1 }
        ],

        // Replace values for the template plugin
        template_replace_values : {
            username : "Some User",
            staffid : "991234"
        }
    });
</script>
<!-- /TinyMCE -->
问题回答

你们需要认识到,锡石并不等于文本。 Tinymce将隐藏在通俗化上的文字,并形成一个用户可以浏览的内容的框架。 因此,需要将锡石储蓄方法称作文字法,以便把金字塔的内容重新写到文本里。

So you need the following code

var editor = tinymce.get( editor_id);
editor.save();  // writes content back to the textarea
// you may now use jQuery or editor.getContent(); to acces the content

背信弃义地这样做

$("#buttontosave").click(function() {
    tinyMCE.triggerSave();
    var status;
    status = $("#menu_create").valid(); //Validate again
   /* if(status==true)
    { 
       //alert( true )
    }
    else 
    { 
         //  alert( false )

    }*/

});

buttontosave your submit button id note : plz validate hidden values also ,don t do like this

ignore:  input[type="hidden"] ,

缩略语

   //ignore:  input[type="hidden"] ,

The following code worked for me and same for you. Just place the following code before your validation calls but after submit is triggered

     var content = tinyMCE.activeEditor.getContent(); // get the content
     $( #textareaID ).val(content);
     

之所以发生这种情况,是因为锡石使你的文本被掩盖。 在<代码>validate前确定这一问题:

$(document).ready(function(){    
    $.validator.setDefaults({
        ignore: []
    });

    // validate call
});




相关问题
Brute-force/DoS prevention in PHP [closed]

I am trying to write a script to prevent brute-force login attempts in a website I m building. The logic goes something like this: User sends login information. Check if username and password is ...

please can anyone check this while loop and if condition

<?php $con=mysql_connect("localhost","mts","mts"); if(!con) { die( unable to connect . mysql_error()); } mysql_select_db("mts",$con); /* date_default_timezone_set ("Asia/Calcutta"); $date = ...

定值美元

如何确认来自正确来源的数字。

Generating a drop down list of timezones with PHP

Most sites need some way to show the dates on the site in the users preferred timezone. Below are two lists that I found and then one method using the built in PHP DateTime class in PHP 5. I need ...

Text as watermarking in PHP

I want to create text as a watermark for an image. the water mark should have the following properties front: Impact color: white opacity: 31% Font style: regular, bold Bevel and Emboss size: 30 ...

How does php cast boolean variables?

How does php cast boolean variables? I was trying to save a boolean value to an array: $result["Users"]["is_login"] = true; but when I use debug the is_login value is blank. and when I do ...

热门标签