Jump to content

JAVA/PHP help! -- Changing and Adding Text inside a TextArea

Featured Replies

Hi, this is quite important to me --

 

I'm making a company site, and need to make some sort of administrator's console, in which - among other things - the admin adds News, users and so on.

In teh "Add News" thing, I want to make the news "HTML" based, means that if there's <b>NEWS TITLE</b> it will appear bold on the news marquee. Obviously.

 

the thing is that the Company's site admins (they're not really admins, they'll just use the admin CP i am making) don't ahve much of a clue in HTML, so I want to make some simple buttons like "B" and "I"... much like there are in this site (when writing a reply or a new thread) -- VERY simple one, not an entire editor, just three or four actions that they can add.

 

So that if they mark "NEWS TITLE BLA BLA" inside the textarea and click on "B" then inside the textarea will appear the text

<B>NEWS TITLE BLA BLA</B>

 

Anyone knows how I do this? I have no clue how to even start, since I'm not that good with Javascript.

 

If anyone knows of a good resource about changing textarea text, I'll appreciate it!!!

 

 

Thanks a lot!!

 

~moo

  • 3 months later...

Here's an example I made on how to do this.

 

Edit: This new file is Valid XHTML 1.0 Transitional, sorry about the HTML mistakes.

biu.txt

duuuuuuuuuuuuuuuuuuude thanks!! I began to lose faith that anyone knows anything about this :)) thanks' date=' I'll check it out now

 

~moo[/quote']

 

No problem, I wrote it in a hurry and I made some HTML mistakes in there.. but I think you'd be able to fix those no problem...

Archived

This topic is now archived and is closed to further replies.

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.