jquery validate和validanguage验证不被隐藏的标签很简单,但是如何验证被隐藏掉的就有点问题啦!
var test;
$(function(){
test= init();
validanguage.el.test={
validations:[{
name:'checkEmpty',,//这里写上自定义的验证方法名称
errorMsg:'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa',
onsubmit:true//什么事件触发, 被隐藏掉的自能使用这个事件控制
}]
};
});
//自定义验证方法
function checkEmpty(){
if(test.getContentTxt() == ""){
alert("ss");
return false;
}
else
return true;
}
//初始化UEditor
function init(){
var option = {
toolbars: [['fontfamily','fontsize','FullScreen', 'source', 'Undo', 'Redo', 'Bold','insertimage','horizontal','insertunorderedlist', 'insertorderedlist', 'link', 'selectall', 'searchreplace','preview','help']],
minFrameHeight : 80,
wordCount: true, //打开字数统计
textarea: 'conten',
initialContent:'Please input.'
};
var editor = new baidu.editor.ui.Editor(option);
editor.autoHeightEnabled = false;
editor.render("editorTest");
return editor;
}
<form action="" id="myform">
<div style="margin-top:20px;width:400px;height:130px;float:left">
<textarea id="editorTest" name="goodsName"></textarea>
</div>
<input type="submit" value="SUBMIT">
</form>