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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...