【发布时间】:2011-03-10 03:12:10
【问题描述】:
我正在为表单和 jquery 验证器插件使用 joomla 默认编辑器,现在我想验证 joomla 文本编辑器不应该为空......我该如何验证?
我阅读了一篇关于 tinymce 验证的文章,我想要类似于 this post
虽然如果我点击切换编辑器而不是验证工作(因为它变成了teaxarea)但是当有 joomla 默认编辑器时,当它为空白时不会显示任何错误
这里是需要的代码
<script type="text/javascript">
jQuery(document).ready(function(){
jQuery("#addBookForm").validate({
rules: {
description: "required"
},
messages: {
description:"Please write description",
}
});
});
</script>
<form id="addBookForm" action="" method="post" >
<table width="100%" border="0" cellpadding="4" cellspacing="2">
<tr>
<td>Description :</td>
<td >
<?php
$editor =& JFactory::getEditor();
$params = array('smilies'=> '0' ,'style' => '0' ,'layer' => '0' ,'table' => '0' ,'clear_entities'=>'0');
$value = isset($this->data['description']) ? $this->data['description'] : '';
echo $editor->display('description', $value,'400','300','20','20',false, $params);
?>
</td>
</tr>
</table>
</form>
【问题讨论】:
标签: php joomla jquery-validate