小编Rob*_*ton的帖子

如何验证tinyMCE弹出文本框值

请任何人帮助我.我需要tinyMCE弹出文本框验证.单击确定时如何验证文本框这里我使用下面的代码.

tinymce.PluginManager.add('weblink', function(editor, url) {
    editor.addButton('weblink', {
        text: 'Web Link',
        icon: false,        
        onclick: function() {
            editor.windowManager.open({
                title: 'Web Link',
                body: [
                {type: 'textbox', name: 'caption', label: 'Enter Your Caption',maxLength:20},
                {type: 'textbox', name: 'weburl', label: 'Enter Your Web URL',maxLength:32}
                ],
                onsubmit: function(e){
                    var weblinkTxt  =   "href='"+e.data.weburl+"'";

                        if(hyperlink!='' && (hyperlink==1 || hyperlink =='1'))
                        {
                            editor.insertContent("<a "+weblinkTxt+">"+ e.data.caption+"</a>")
                        }
                        else
                        {
                            editor.insertContent("<img src='"+emailImg+"'>"+ e.data.caption+" "+e.data.weburl)
                        }

                }
            });
        }
    });  
});
Run Code Online (Sandbox Code Playgroud)

javascript jquery tinymce

3
推荐指数
1
解决办法
801
查看次数

标签 统计

javascript ×1

jquery ×1

tinymce ×1