GuruMeditation Posted April 30, 2017 Share Posted April 30, 2017 Hello all.... So I have CKEditor installed on the front end, but when the form is submitted, it's returning nothing and I have no idea why... All of the following code is set up correctly, i.e in the appropriate <head><body> sections etc. <script src='https://######.com/###/site/ck/ckeditor.js'></script> <?php if($notices) { foreach($notices as $notice) { echo $notice->text; } } $session->removeNotices(); ?> <?php if($input->post->submit) { $editor_data = $input->post->comment; $session->message('<pre>' . $editor_data . '</pre>'); $session->redirect('./'); } ?> <form method='post'> <input type='textarea' id='comment' name='comment'> <input type='submit' name='submit'> </form> <script> CKEDITOR.replace( 'comment' ); </script> If I submit the form as above, then $input->post->comment ($notice->text) returns empty. If however I remove the following code: <script> CKEDITOR.replace( 'comment' ); </script> ... then the form submits correctly, so it's obviously an issue with CKEditor. Does anyone have any advice on what's happening? I have tried a local installation of CKEditor and the CDN, but it's still the same result. Link to comment Share on other sites More sharing options...
Robin S Posted April 30, 2017 Share Posted April 30, 2017 Your textarea tag isn't valid. Instead of... <input type='textarea' id='comment' name='comment'> ...it should be... <textarea id='comment' name='comment'></textarea> 3 Link to comment Share on other sites More sharing options...
GuruMeditation Posted April 30, 2017 Author Share Posted April 30, 2017 Thanks a lot, that sorted it! 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now