I'm trying to implement FCKeditor with JQuery and the Form plugin. It's almost working. The problem being, when I submit the form, the first time, the editor sends the default text: 'Default text in editor' for example, even when there is something different in there.
If I submit the form again, without changing anything, this time the editor sends the correct text: eg. 'What I typed into the editor the first time....'
is there any way to solve this? Code below:
<script type="text/javascript" src="../javascript/jquery.js"></script>
<script type="text/javascript" src="../javascript/jquery.form.js"></script>
<script type="text/javascript">
// prepare the form when the DOM is ready
$(document).ready(function() {
var options = {
target: '#output1', // target element(s) to be updated with server response
};
// bind form using 'ajaxForm'
$('#edit_form').ajaxForm(options);
});
</script>............
........<form action="processform.php" method="post" id="edit_form">
<input type="submit" name="save" value="Save Article" id="save" />
</form>
If I submit the form again, without changing anything, this time the editor sends the correct text: eg. 'What I typed into the editor the first time....'
is there any way to solve this? Code below:
<script type="text/javascript" src="../javascript/jquery.js"></script>
<script type="text/javascript" src="../javascript/jquery.form.js"></script>
<script type="text/javascript">
// prepare the form when the DOM is ready
$(document).ready(function() {
var options = {
target: '#output1', // target element(s) to be updated with server response
};
// bind form using 'ajaxForm'
$('#edit_form').ajaxForm(options);
});
</script>............
........<form action="processform.php" method="post" id="edit_form">
<?php $oFCKeditor = new FCKeditor('editor'); $oFCKeditor->BasePath = '/javascript/fckeditor/'; $oFCKeditor->Value = 'Default text in editor'; $oFCKeditor->Create(); ?>
<input type="submit" name="save" value="Save Article" id="save" />
</form>
RE: FCKeditor and JQuery (with Form plugin)
I had the same problem.
I used this fix found here:
http://wiki.fckeditor.net/Troubleshooti ... 598c4eb4ff
I attached the fix to my submit button as suggested in the last section.
Hope this helps.