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

#1
[eluser]Ramania[/eluser]
Hello CIs,

i am trying to post back the validated fields to FCKeditor, the problem is, the code gets back as FCKeditor sends it and it goes directly to the value not to the source, i tried to look the FCKeditor configuration documents but they mention nothing about this except for HTML entities, and i enabled processing HTML entities but still it's not working, i was just wondering if someone has a solution to this, and if i didn't make my point clear, what i want is a simple way to retrieve the validation field without breaking it into FCKeditor, i tried the prep_for_form but it won't work, here my code anyways.

The controller part:
Code:
$rules['news_title'] = "trim|required|min_length[5]|max_length[100]|xss_clean";
    $rules['news_body'] = "prep_for_form|trim|required|min_length[15]|max_length[1000]|xss_clean";
    $rules['news_cat_id'] = "required";
    $rules['news_keywords'] = "required";
    
    $this->validation->set_rules($rules);
    
    $fields['news_title'] = "news_title";
    $fields['news_body'] = "news_body";
    $fields['news_cat_id'] = "news_cat_id";
    $fields['news_keywords'] = "news_keywords";
    
    $this->validation->set_fields($fields);

The View part:

Code:
$oFCKeditor = new FCKeditor('news_body') ;
$oFCKeditor->BasePath = '/mmdportal/editors/fckeditor/' ;
$oFCKeditor->Value = $this->validation->news_body;
$oFCKConfig->config['ProcessHTMLEntities'] = true ;
$oFCKeditor->Create() ;

thank you guys, and i am sorry if i am not making my self clear i am just so sleepy and tired Big Grin

#2
[eluser]Ramania[/eluser]
i solved it in case anyone is looking for a similar problem, i just changed the code to

Code:
$oFCKeditor->Value = html_entity_decode($this->validation->news_body);


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


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