This syntax for some reason isn’t working and I’m wondering why. When I alert the values in the page, I can see everything but the textarea value. I’m not even getting an undefined.
var report = $("textarea#report").val();
Here is my html:
<textarea id="report" name="report" rows="25" cols="10" style="width:100%;height:200px;"><?php echo $_POST['report']; ?></textarea>
<form id="rpt" action="">
I have this code that Paolo helped me with last week. This is the start of the jquery code which also has some editor code mixed in with it
$(document).ready(function()
{
$('.error').hide();
WYSIWYG.attach('dfarReport', rpt);
WYSIWYG_Core.addEvent(window, "load", function()
{
$('#Save').removeAttr('onclick').click(function()
{
I tried adding Jonathan’s suggested code to this but I get errors when I do this. I also changed “report” to something different just in case but that didn’t help either.
IT’S WORKING !!!!!!!!!!!!!!!!!!!!
To get this to work. I added the following:
$(document).ready(function()
{
$('.error').hide();
WYSIWYG.attach('dfarReport', dfar);
WYSIWYG_Core.addEvent(window, "load", function()
{
$('#Save').removeAttr('onclick').click(function()
{
WYSIWYG.updateTextArea('dfarReport'); <-------------- This is where it needs to go
EDIT
should be working, however, if you’re referencing it by id, then you don’t need to use
textareaas wellwould be equivalent
Also, Are you sure about the name. no typos?
Edit
with OpenWYSIWYG, use
WYSIWYG.updateTextArea('report');before calling the value via javascript