Smart questions
Smart answers
Smart people
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

Join Tek-Tips
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

LINK TO THIS FORUM!

Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

Partner With Us!

"Best Of Breed" Forums Add Stickiness To Your Site
Partner Button
(Download This Button Today!)

Feedback

"...The forum looks great! You guys have done a fantastic job on arranging things there...Your site is very precise and fun to visit..."

Geography

Where in the world do Tek-Tips members come from?

textarea (WYSIWYG text editor) - the html code generated won't save into my DB table.....

MDEJAKE (MIS)
12 Jul 12 7:18

Hi CFguys,

I have a textarea form on my page...and I made my textarea field like an Editor for my content to be able modify(font,headings,alignment etc).
But when I'm about to insert it to my DB table, insert won't continue.
i've set my table column as LongText data-type....

I made some testing and debugging and found out that the problem is the generated code produced by my text editor. IS there any possible solution on this one? I badly needed to use the Text Editor and save values into my Database.


Any help or suggestions?

Btw...I used the Tiny MCE and the ckeditor =)
LyndonOHRC (Programmer)
12 Jul 12 14:13
Are you using cfquereyparam tag in your insert/update process?

Lyndon

---People Remember about 10% of what you say ---They never forget how you made them feel. Covey

MDEJAKE (MIS)
13 Jul 12 0:35
Nope I'm not using cfqueryparam tag.


I found that the html generated code were not completely saved into my table column.
For example, the generated html code were :

CODE

<h3 style="color:blue;">
    Marriott to open first Sri Lankan property</h3>
<p>
   <br />
    <strong>After</strong> signing an agreement with Weligama Hotel Properties Ltd, the Marriott Hotels & Resorts brand plan to open their first Sri Lankan hotel.</p> 


When I actual checked my table-column on the DB, only the

CODE

<h3 style= 

were saved.

That's the reason when I output the value on the page, the display is blank.

Any suggestions or help?

Thanks.
MDEJAKE (MIS)
13 Jul 12 4:25

I have used the<CFQUERYPARAM> tag on my SQL query insert statement,
<cfqueryparam cfsqltype="CF_SQL_VARCHAR" value="#form.f_content3#">
but im still getting the same problem/issue.

Any help please? Thanks.
LyndonOHRC (Programmer)
13 Jul 12 8:38
I ran the attached code and it saved all of the html into my database column just fine. [my database column type is memo] If my test code is what you are trying to achieve, perhaps you should share more of your code.

CODE

<cfset var.hyperText='<h3 style="color:blue;">
    Marriott to open first Sri Lankan property</h3>
<p>
   <br />
    <strong>After</strong> signing an agreement with Weligama Hotel Properties Ltd, the Marriott Hotels & Resorts brand plan to open their first Sri Lankan hotel.</p>'>
<cfquery name="putHT" datasource="#MyData#" >
	Insert Into hyperTextNote(editorData)
	Values( <cfqueryparam cfsqltype="cf_sql_longvarchar" value="#var.hyperText#" >)
</cfquery> 

Lyndon

---People Remember about 10% of what you say ---They never forget how you made them feel. Covey

MDEJAKE (MIS)
15 Jul 12 23:13


That's good to hear for MS-Access has no problem inserting.

Im using the MySQL Database,(MyISAM engine), and datatype is LONGTEXT.

And here's the insert statement.

CODE

<cfquery datasource="#ds#" name="q_insert">
	INSERT INTO tb_article
	(d_name,d_content)
	VALUES(
          <cfqueryparam cfsqltype="CF_SQL_VARCHAR" value="#form.f_name#">,
          <cfqueryparam cfsqltype="cf_sql_longvarchar" value="#form.f_content#">
         )
</cfquery> 

Any idea on my problem/issue? Thanks.


LyndonOHRC (Programmer)
16 Jul 12 8:30
I have not used MySQL, however the query worked for me using a MSSQL 2008R2 datasource...

You've not shared your code where the value of d_content is set. If your sure there is no issue there, I would suggest you ask for help on the MYSQL forum and link to this thread.

Lyndon

---People Remember about 10% of what you say ---They never forget how you made them feel. Covey

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close