tinymce and jquery

Posted by tirso on Stack Overflow See other posts from Stack Overflow or by tirso
Published on 2009-12-11T03:00:10Z Indexed on 2010/05/23 13:00 UTC
Read the original article Hit count: 341

Filed under:

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();
	});	
});

© Stack Overflow or respective owner

Related posts about jQuery