之前在JSP页面中,表单里有一个文本框.
提交
进行验证的JS代码:String.prototype.trim = function(){
return this.replace(/(^[\s]*)|([\s]*$)/g, "");
}
function validate(form) {
var oForm = document.getElementById(form);
if(oForm.submitted) {
return;
}
if(oForm.content.value.trim() == ""){
alert("请输入内容");
return;
}
oForm.submitted = "true";
oForm.submit();
}
之前使用是正常的.但是加了TinyMCE后
tinyMCE.init({
mode : "textareas",
theme : "advanced",
language : "zh",
theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "left",
theme_advanced_buttons1 : "bold, italic, underline, forecolor, backcolor, |, formatselect, fontsizeselect, |, bullist, numlist",
theme_advanced_buttons2 : "",
theme_advanced_buttons3 : ""
});
文本框里已经输入值了,可是还是弹出警告"请输入内容".当把页面再刷新一次又能提交成功.
求前辈们帮忙解释和解决.