本文介绍了ASP.NET MVC 3不显眼的审定,提交和TinyMCE的的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一个正在移植到jQuery的TinyMCE的一个内部开发的文件/图片/文档管理器插件。与此同时,我们的一些项目,这些项目依赖于这些功能需要使用TinyMCE的与放大器的基于原型的版本; jQuery.noConflict()。这适用于不显眼的审定但是罚款ASP.NET MVC 3提交验证TinyMCE的回调之前发生了TinyMCE'ed内容复制到表单字段被触发。是否有可能钩到不显眼的验证?

We have an in-house developed file/image/document manager plugin for TinyMCE that is still being ported over to jQuery. In the mean time, some of our projects that rely on having these features need to use the Prototype-based version of TinyMCE & jQuery.noConflict(). This works fine however with unobtrusive validation in ASP.NET MVC 3 the validation on submit happens before the TinyMCE callback to copy the TinyMCE'ed contents to the form field is triggered. Is it possible to hook into a pre-validation event in the unobtrusive validation?

推荐答案

如果您正在使用的提交按钮后表单,试试这个:

If you are using submit buttons to post the form, try this:

$("input[type='submit']").click(function () {
    tinyMCE.triggerSave();
});

如果你不使用提交按钮,只是挂钩到任何事件表单提交之前立即发生,并呼吁tinyMCE.triggerSave()。

If you're not using submit buttons, just hook into whatever event happens immediately before form submission and call tinyMCE.triggerSave().

这篇关于ASP.NET MVC 3不显眼的审定,提交和TinyMCE的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-14 09:14