• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
FCKeditor and form helper

#1
[eluser]tfncruz[/eluser]
Hi,
I'm creating a form inside the controller. In that same form I'm using fckeditor for textareas. A strange thing happens when I load e page. The fckeditor appears before the entire form... not inside. Anyone know why's this happening?

here's the function that returns the form:
Code:
private function getAdicionarAutorForm() {
        $attributes = array('id' => 'adicionarAutorForm');
        $hidden = array('fotoDimensoes');
        
        $form = form_fieldset(' Adicionar Autor ');

        $form .= form_open_multipart('admin_addAutor/add', $attributes, $hidden);    
        $form .= "<ul>";
        
        $form .= "<li>";
        $form .= form_label('nome');
        $form .= form_input('nome', $this->validation->nome);
        $form .= $this->validation->nome_error;
        $form .= "</li>";

        $form .= "<li>";
        $form .= form_label('data de nascimento');
        $form .= form_input('dataNascimento', $this->validation->dataNascimento);
        $form .= $this->validation->dataNascimento_error;
        $form .= "(aaaa-mm-dd)";
        $form .= "</li>";

        $form .= "<li>";
        $form .= form_label('local de nascimento');
        $form .= form_input('localNascimento', $this->validation->localNascimento);
        $form .= $this->validation->localNascimento_error;
        $form .= "</li>";

        $form .= "<li>";
        $form .= form_label('residĂȘncia');
        $form .= form_input('residencia', $this->validation->residencia);
        $form .= $this->validation->residencia_error;
        $form .= "</li>";

        $form .= "<li>";
        $form .= form_label('excerto');
// FCKeditor
        $this->fckeditor->BasePath = base_url().'assets/js/FCKeditor/';
        $this->fckeditor->Config["CustomConfigurationsPath"] = base_url().'assets/js/fck_plpConf.js';
        $this->fckeditor->ToolbarSet = 'PLP';
        $form .= $this->fckeditor->Create();
        $form .= "</li>";
        
        $form .= "<li>";
        $form .= form_label('sobre o autor');
        $form .= form_textarea('sobreAutor', $this->validation->sobreAutor);
        $form .= "</li>";

        $form .= "<li>";
        $form .= form_label('imagem');
        $form .= form_upload('fotoURL', $this->validation->fotoURL);    
        $form .= "</li>";

        $form .= "<li>";
        $form .= form_label('titulo da imagem');
        $form .= form_input('fotoTitulo', $this->validation->fotoTitulo);
        $form .= "</li>";

        $form .= "<li>";
        $form .= form_submit('submit', 'adicionar autor');
        $form .= "</li></ul>";
        $form .= form_close();
        $form .= form_fieldset_close();

        return $form;
    }

Thanks!

#2
[eluser]macigniter[/eluser]
I believe you must use $this->fckeditor->CreateHTML(); instead of $this->fckeditor->Create();

#3
[eluser]Yash[/eluser]
call function last when everything gets load ..or atleast call func in last lines

#4
[eluser]tfncruz[/eluser]
Everything's working fine now. I changed to CreateHTML().

Thanks again!

#5
[eluser]Stefano G[/eluser]
Hello, this thread:

http://ellislab.com/forums/viewthread
/59265/


maybe can help...

cheers

Stefano


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.