Response title
This is preview!
$(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){
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"
});
$("#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!");
}
});
}});
});
$('.close').click(function (e) {
e.preventDefault();
$.modal.close();
});
});
© 2013 jQuery Foundation
Sponsored by and others.