Textarea

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
catalaur
Forum Newbie
Posts: 6
Joined: Sat Jul 15, 2006 2:00 pm

Textarea

Post by catalaur »

Hi . I have to problems with php.
First one:
I use a javascript function for making text bold in textarea field. That functions puts something like this: text how can i change that to <b>.
Any php function for that?

And the second one also with textarea
I want to have in the lift side of textarea a frame or something that counts the current line number and that is scrolled in the same time with textarea.

Any idea?
User avatar
onion2k
Jedi Mod
Posts: 5263
Joined: Tue Dec 21, 2004 5:03 pm
Location: usrlab.com

Post by onion2k »

Moved to clientside.

All these things will require JavaScript rather than PHP.
catalaur
Forum Newbie
Posts: 6
Joined: Sat Jul 15, 2006 2:00 pm

Post by catalaur »

No problem. But how can i do that with jscript?
User avatar
Maugrim_The_Reaper
DevNet Master
Posts: 2704
Joined: Tue Nov 02, 2004 5:43 am
Location: Ireland

Post by Maugrim_The_Reaper »

If you want to see the actual tags just use:

[/syntax]document.getElementById('textarea_id').innerHTML = '<b>' + {put your text to be bolded} + '</b>';

Code: Select all


You'll see the <b> tags and they'll not be parsed by browser - makes sure you're actually using a textarea...

Post Reply