如何阻止Jquery.TinyMCE提交来自当我单击保存按钮时
How to Stop Jquery.TinyMCE From Submitting the from when I click Save button
每当我点击Tinymce编辑器的"保存"按钮时,表单都会提交到服务器。我需要停止表单提交。我搜索了很多,但找不到任何解决方案。这是我的代码,
$('textarea.tinymce').tinymce({
paste_retain_style_properties : "margin, padding, width, height, font-size, font-weight, font-family, color, text-align, ul, ol, li, text-decoration, border, background, float, display",
script_url : path_global+'/js/TinyMCE/tiny_mce.js',
valid_children : "+body[style]",
theme : "advanced",
plugins : "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",
theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect,fontselect,fontsizeselect",
theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor",
theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen",
theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,pagebreak",
theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "left",
theme_advanced_statusbar_location : "bottom",
theme_advanced_resizing : true,
setup : function(ed) {
ed.onSaveContent.add(function(ed, l) {
});
}
});
更新:我已经找到了答案。深入研究源代码,我发现我可以在表单标签上添加 onsubmit = "返回 false",这将阻止表单提交。
我已经找到了答案。挖掘我发现我可以添加的来源,
onsubmit = "return false"
在表单标签上,这将阻止表单提交。
相关文章:
- 当用户单击保存按钮时,标签会显示一条消息
- 单击时将类添加到 ancer 标签并使用 cookie 保存
- 如何保存从单击this.nameClass动态设置的本地存储
- 如何通过单击唯一按钮保存下拉菜单/复选框菜单选项和占位符值
- 在表中创建带有输入的新行,然后单击保存该输入的值
- 单击指向外部网站的链接后,通过MySQL保存数据
- 如何访问HTML中的属性值以保存在数据库中单击按钮
- 单击图像,获取坐标并将其保存在数据库JavaScript和Rails中
- 强制浏览器在单击链接后保存文件
- 在浏览器返回/forwd 按钮单击时保存/恢复所有 JavaScript 变量
- 如何将内容保存在使用 greasemonkey 单击链接时弹出的 html 框架中
- 检查输入类型并在单击保存时跳过输入“密码”字段
- 如何阻止Jquery.TinyMCE提交来自当我单击保存按钮时
- 离子类型错误:第一次单击保存按钮时无法读取未定义的属性“标题”
- 单击“保存到CSV”按钮后显示通知(如果未安装Flash Player)
- 将HTML Select附加到输入,并在用户单击“保存”按钮后存储它们的值.我正在处理的
- onbeforeunload,除非单击保存或提交按钮
- 如何在“另存为”对话框中自动单击“保存”
- JavaScript是否有可能阻止人们右键单击保存图像?
- 单击保存按钮进行验证的java脚本