2010-06-30 6 views
1

양식 및 jquery 유효성 검사기 플러그인에 대한 joomla 기본 편집기를 사용하여, 지금 나는 그 joomla 텍스트 편집기를 비어 있지 않아야 유효성을 확인하고 싶습니다 .... 내가 어떻게 확인합니까 ?? joomla 기본 텍스트 편집기를 확인하는 방법?

은 내가, 내가 (이 teaxarea로 전환 사촌) 내가 검증 작업에 비해 토글 편집기를 클릭하면 있지만 this post

유사 싶지만 Joomla를 기본 편집기가있을 때 다음 표시되지 않습니다 TinyMCE에 대한 검증에 관한 기사를 읽고 그것은 비어 오류 때 여기

당신이보기에 대해 다음 코드를 추가하여이를 달성 할 수

<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> 

답변

2

reuired 코드를입니다

$js="function validateEditor(){ 
     var content = ".$editor->getContent('editorName')."; 
     return content;     
    }"; 
$document =& JFactory::getDocument(); 
$document->addScriptDeclaration($js); 

양식을 제출하기 전에이 Java 스크립트 함수 (validateEditor)를 호출하십시오.

+0

나는 코드를 테스트하지 않았다. (나는 Joomla 프로젝트를 떠난다.) 어쨌든 해결책 주셔서 감사한다. – diEcho

관련 문제