TINYMCE Textbox not updating

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
hayward03Asked:
Who is Participating?
 
hayward03Connect With a Mentor Author Commented:
Hi,

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

Regards

Michael
0
 
dejaanbuCommented:
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
 
hayward03Author Commented:
Hi,

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

Regards

Michael
0
Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

 
dejaanbuCommented:
your tinymce textbox name is  "txtArticle" or "txtPlainText" ?
0
 
hayward03Author Commented:
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
 
hayward03Author Commented:
I solved my own issue
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.