validation and tinymce

validation and tinymce

hi to all

I am using jquery.validate.js , simple modal plugin and tinymce. Here is the scenario, first opening of modal window with tinymce is working fine even the validation. But, on the second time or more opening of modal window I could type with the textarea and the validation mouseout is still working fine but the submit button doesn't work anymore. I tried to remove the validate and it worked it out. If anyone could see in live then I would post it.

Any suggestion would greatly appreciated

Thanks in advance

here is the code

$(document).ready(function() {   
   $('.basic').click(function (e) {
      $('#basic-modal-content').modal({onShow: function (dialog) {
            // General options
            mode : "textareas",
            theme : "advanced",
            setup : function (ed) {
                  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.")
            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"
            debug: true,
            errorElement: "span",         
            success: function(span) {
            rules: {
               name: {
            submitHandler: function() {
               var y =  tinyMCE.get('test').getContent();
   $('.close').click(function (e) {