Jump to content
GuruMeditation

CKEditor firing blanks (front-end)

Recommended Posts

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.

Share this post


Link to post
Share on other sites

Your textarea tag isn't valid. Instead of...

<input type='textarea' id='comment' name='comment'>

...it should be...

<textarea id='comment' name='comment'></textarea>

 

  • Like 3

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...