Announcement

Do not use the forums to submit bug reports, feature requests or patches, submit a New Ticket instead.

#1 2010-07-12 14:00:34

dr_robert
Xinha Community Member
Registered: 2010-07-12
Posts: 12

Preload Text in Text Area

Hello All,

I'm sure this is a newbie question, but I figured I'd ask. smile

I've gone ahead and followed all the instructions in the "Newbie Guide" and all of that went well (great guide!).

My question is this...

When the editor first loads, I need the text area to display previously entered text that I have stored in a database.

If I was going to do this with a regular text area, I would just use:

<textarea name="textblock1" id="textblock1" cols="45" rows="5">This is a test.</textarea>

Do I do the same thing even with Xinha active?

Thanks for your help... and sorry about the pure newbie question.

On a side note, this script looks amazing!

Offline

#2 2010-07-12 17:58:21

gogo
Xinha Leader
From: New Zealand
Registered: 2005-02-11
Posts: 1,015
Website

Re: Preload Text in Text Area

Yes, remember to entise (in php, use htmlspecialchars)


James Sleeman

Offline

#3 2010-07-12 18:06:59

dr_robert
Xinha Community Member
Registered: 2010-07-12
Posts: 12

Re: Preload Text in Text Area

Thanks for the reply James!

I'm just not 100% sure what you mean by: "remember to entise (in php, use htmlspecialchars)"

Is that a Xinha config parameter or something I'm supposed to be aware of?

Thanks again! Your help is greatly appreciated. smile

Offline

#4 2010-07-12 21:06:46

gogo
Xinha Leader
From: New Zealand
Registered: 2005-02-11
Posts: 1,015
Website

Re: Preload Text in Text Area

<textarea><?php echo htmlspecialchars('<h1>The HTML</h1><p>You want to edit.</p>'); ?></textarea>

Or whatever the equivalent is in your preferred language.

The below however is NOT valid, very common mistake...

<textarea><h1>The HTML</h1><p>You want to edit.</p></textarea>

James Sleeman

Offline

Board footer

Powered by FluxBB