Question

I'm getting a really weird problem where the WYSIWYG editor redactor is not posting the values to the server. Here is how I'm implementing it:

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.js"></script>
<link rel="stylesheet" href="/assets/shared/javascripts/redactor/redactor.css" />
<script src="/assets/shared/javascripts/redactor/redactor.js"></script>

<script type="text/javascript">
$(document).ready(function() {
    $('#redactor_content').redactor({
    imageUpload: '/upload/image/<?=$_GET['id']?>/',
    imageGetJson: '/upload/index/<?=$_GET['id']?>/'
    });
});
</script>

<textarea name="content" id="redactor_content"></textarea>

And I'm trying to retrieve the post value using $_POST['content'].

I thought it might be the older version of the jQuery library but if I use the demo scripts it works fine with jQuery 1.7.2. I'm not seeing anything in the console and I checked it's not working in both Chrome and Firefox. Any suggestions would be greatly appreciated.

Was it helpful?

Solution

The issue was some malformed HTML that was causing both Chrome and Firefox to automatically close the form tag early. I moved the opening form tag further up and now see all post data from the WYSIWYG editor (redactor). Hope this helps someone else.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top