1 Star 0 Fork 296

天夜孤风/ueditor-plus

forked from ModStartLib/ueditor-plus 
加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
jqueryValidation.html 2.59 KB
一键复制 编辑 原始数据 按行查看 历史
git 提交于 2025-04-15 13:37 +08:00 . 优化:清除缓存
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<title>Ueditor在jquery validation下的验证</title>
<script src="./example.js"></script>
<script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.8.3.min.js"></script>
<script type="text/javascript"
src="http://ajax.aspnetcdn.com/ajax/jquery.validate/1.10.0/jquery.validate.min.js"></script>
<script type="text/javascript" charset="utf-8" src="../ueditor.config.js"></script>
<script type="text/javascript" charset="utf-8" src="editor_api.js"></script>
<script>
$(function () {
UE.getEditor('content');
var validator = $("#myform").submit(function () {
UE.getEditor('content').sync();
}).validate({
ignore: "",
rules: {
title: "required",
content: "required"
},
errorPlacement: function (label, element) {
label.insertAfter(element.is("textarea") ? element.next() : element);
}
});
validator.focusInvalid = function () {
if (this.settings.focusInvalid) {
try {
var toFocus = $(this.findLastActive() || this.errorList.length && this.errorList[0].element || []);
if (toFocus.is("textarea")) {
UE.getEditor('content').focus()
} else {
toFocus.filter(":visible").focus();
}
} catch (e) {
}
}
}
})
</script>
<script>var _hmt = _hmt || [];
(function () {
var hm = document.createElement("script");
hm.src = "https://hm.baidu.com/hm.js?f84f35a44b5cc5c0b10c3fabdf0f322b";
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(hm, s);
})();</script>
<link rel="stylesheet" href="./style.css"/>
</head>
<body class="demo-editor-page">
<div>
<form id="myform" action="">
<h3>Ueditor在jquery validation下的验证</h3>
<label>其他内容</label>
<input name="title"/>
<br/>
<label>编辑器</label>
<textarea id="content" name="content" rows="15" cols="80" style="width: 80%"></textarea>
<br/>
<input type="submit" name="save" value="Submit"/>
</form>
</div>
</body>
</html>
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/wanggood/ueditor-plus.git
git@gitee.com:wanggood/ueditor-plus.git
wanggood
ueditor-plus
ueditor-plus
master

搜索帮助