tags:

views:

272

answers:

1

hi to all

I am using tinymce and simple modal (jquery plugin). Initially, it was not worked (meaning I cannot type in the textarea) for the second or more opening modal dialog unless I refreshed the page. Now I changed my code and now I could type but the problem persist is the submit button doesn't work anymore. I tried to trace in firebug and I found some errors like this

Thanks in advance

Permission denied to get property XULElement.accessibleType [Break on this error] var tinymce={majorVersion:"3",minorVersi...hanged();return true}return false})})();

here is the revised code

$(document).ready(function() { 
 $('.basic').click(function (e) {
  e.preventDefault();  
  $('#basic-modal-content').modal({onShow: function (dialog) {
   tinyMCE.init({
    // General options
    mode : "textareas",
    theme : "advanced",
    setup : function (ed) {
     ed.onKeyPress.add(
      function (ed, evt) {
       var y =  tinyMCE.get('test').getContent();
       $('#rem_char').html(100 - y.length);
       if (y.length == 100){
        //ed.getWin().document.body.innerHTML = y.substring(0,100);
        alert("Your element has exceeded the 100 character limit. If you add anymore text it may be truncated when saved.")
        return; 
       }
      }
     );
    },   
    plugins : "safari,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",

    // Theme options
    theme_advanced_buttons1 : "bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull",
    theme_advanced_buttons2 : "fontselect,fontsizeselect,bullist,numlist,forecolor,backcolor",
    theme_advanced_buttons3 : "",  
    theme_advanced_toolbar_location : "top",
    theme_advanced_toolbar_align : "left",
    dialog_type : "modal"
   }); 
   return false;
  }});
 });
 $('.close').click(function (e) {
  e.preventDefault(); 
  $.modal.close();
 }); 
});
A: 

Are your HTML page and all Javascripts called from the same domain? (domain.com and www.domain.com are different domains).

Pekka
hi pekka,Yes, I am using the same domain.Thanks
tirso
hi to allI found out that there is a conflict with tinymce and jquery plugin validatation. I tried to remove validate then it works fine.Any thought or suggestion the problem?here is my validation code $("#create_school").validate({ debug: true, errorElement: "span", success: function(span) { span.text("ok!"); }, rules: { name: { required:true, minlength:5, }, }, submitHandler: function() { var y = tinyMCE.get('test').getContent(); alert(y.length); alert("Submitted!"); } });
tirso