Solved

TINYMCE Textbox not updating

Posted on 2012-03-21
6
701 Views
Last Modified: 2012-03-27
Hi,

I have a textbox that is using TinyMce and it works fine, but when I enter in text and then click save it doesn't make it through to my SQL string to insert into the database.

Below is the code for my textbox

<asp:TextBox ID="txtArticle" Enabled="false" runat="server" Height="250px" TextMode="MultiLine" Width="600px"></asp:TextBox>

Then the code below is the code Im using in the codebehind

string ShortArticle = txtPlainText.Text;

string query1 = "UPDATE database SET shortArticle='" + ShortArticle + "' WHERE newsid='" + newsid + "'";

Any help would be greatly appreciated

Regards

Michael
0
Comment
Question by:hayward03
  • 4
  • 2
6 Comments
 
LVL 14

Expert Comment

by:dejaanbu
ID: 37748928
try this,

have a javascript function
<script type="text/javascript">
function UpdateTextArea() {                                     
            tinyMCE.triggerSave(false, true);
        }
</script>

Open in new window


call it before submitting,
<asp:Button ID="itheButton" runat="server" OnClientClick="UpdateTextArea();"  />

Open in new window

0
 

Author Comment

by:hayward03
ID: 37748960
Hi,

Thank you for your help, but this didnt work either...no error, but just didnt update.

Regards

Michael
0
 
LVL 14

Expert Comment

by:dejaanbu
ID: 37751676
your tinymce textbox name is  "txtArticle" or "txtPlainText" ?
0
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

 

Author Comment

by:hayward03
ID: 37751707
Sorry the code is below:

<asp:TextBox ID="txtArticle" Enabled="false" runat="server" Height="250px" TextMode="MultiLine" Width="600px"></asp:TextBox>

string ShortArticle = txtArticle.Text;

string query1 = "UPDATE database SET shortArticle='" + ShortArticle + "' WHERE newsid='" + newsid + "'";
0
 

Accepted Solution

by:
hayward03 earned 0 total points
ID: 37751869
Hi,

This was me being DUMB as I just saw that I had textbox enabled="false"

Regards

Michael
0
 

Author Closing Comment

by:hayward03
ID: 37770355
I solved my own issue
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.

813 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now