Welcome Guest, Not a member yet? Register   Sign In
ckeditor & form validation
#6

[eluser]incog03[/eluser]
So i figured out (probably a really bad way!) how to do it and it works fantastically.

So the user enters information into the form, submits, validation fails because of some of the other text boxes or whatever.

All I needed to do was strip the tags each time validation failed, add the existing data back into the textarea and ckeditor magically restyles it how it was, don't ask me how.

Controller.php
Code:
$data['test'] = $this->input->post('MainContent');
    strip_tags($data['test']);

view.php
Code:
<?php $this->ckeditor->editor('MainContent', $test );?>

And the best part is, when validation is successful, the final version of the textarea data is stored nicely in the database with all tags still attached, ready to be called Big Grin Magic!


Thanks a lot, I appreciate your help guys/girls


Messages In This Thread
ckeditor & form validation - by El Forum - 04-06-2011, 05:56 PM
ckeditor & form validation - by El Forum - 04-06-2011, 09:13 PM
ckeditor & form validation - by El Forum - 04-07-2011, 06:23 AM
ckeditor & form validation - by El Forum - 04-07-2011, 07:30 AM
ckeditor & form validation - by El Forum - 04-07-2011, 10:19 AM
ckeditor & form validation - by El Forum - 04-07-2011, 11:51 AM
ckeditor & form validation - by El Forum - 04-07-2011, 12:03 PM
ckeditor & form validation - by El Forum - 06-12-2011, 08:00 AM
ckeditor & form validation - by El Forum - 06-12-2011, 08:13 AM



Theme © iAndrew 2016 - Forum software by © MyBB