Jump to content

tinymce textarea content not updating


Advamax

Recommended Posts

Hi guys,

 

I searched the web for solutions, but no luck for my case so far. I have a custom CMS that uses tinymce and input text boxes in a form. The tinymce textarea as well as the input text boxes pull the current data from the database, and allows the user to change it, from where the changes are passed on to be updated in the database. All input text boxes work 100%, except for the tinymce textarea. It keeps on passing the original data that was pulled from the database, and not the changed data.

 

The form (simplified):

 

<form enctype="multipart/form-data" method="post" action="page_update.php">
		Button Name: <input type="text" name="btn_name" style="width:150px" value="<?php echo $current_link;?>"><br>

		Content: <textarea id="elm1" name="elm1" rows="15" cols="80" style="width: 80%">
			<?php echo $current_content; ?>
		</textarea>

		<input type="hidden" name="pid" value="<?php echo $page_id; ?>">
	<input type="submit" name="save" value="Submit" />
	<input type="reset" name="reset" value="Reset" />
</form>

 

The php code (simplified):

$upd_name = $_POST["btn_name"];
$upd_content = $_POST["elm1"];
$upd_pid = $_POST["pid"];

echo "Content = ".$upd_content;	

mysql_query("UPDATE pages SET Content='$upd_content', Link='$upd_name' WHERE ID=".$upd_pid);

 

With the "echo" line I can see that the changed data wasn't passed, but the original data from the database. All my input text boxes works just fine.

 

I have checked my code that the data isn't pulled from the database again somewhere between the form and the update code, and that is ruled out.

 

For what it is worth, I have previously done something similar, except for that the form (with tinymce textarea) displayed in a javascript popup window, and the changed data was sent correctly.

 

Any ideas?

 

Thanks in advance

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

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.   Restore formatting

  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.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.