Jump to content


inserting text into a textarea with a button ex surroundText?

  • Please log in to reply
2 replies to this topic

#1 pentan

  • Members
  • PipPip
  • Member
  • 19 posts

Posted 27 August 2006 - 05:07 AM

Ok... simplest way to say it is I want to be able to do like you can when you responsd to a thread here:  You have buttons that had in the markers in the text area for things like hitting the "B" button puts in here .  I've tried to figure it out from looking at the code on this very page and searching for it, but I can't seem to get it to work.  Anyone know of a tutorial?
Michael Shaffer
"You know you have it, but can you _show_ you have it?"

#2 gerkintrigg

  • Members
  • PipPipPip
  • Magician
  • 828 posts
  • LocationBristol, UK
  • Age:37

Posted 27 August 2006 - 07:16 AM

I don't know of a tutorial to do it, but if you'd like a hint, I'd probably use javascript to insert an extra bit of text. Not sure exactly how though. It could be done by using the b button as a form submit button which takes the text of the area and adds the required code to the box. You'd then need to interpret the code at runtime by finding the text between the two tags and changing it, then deleting the tags. I think this is called XML, but it's a fancy way of saying "make up your own tags".

Hope this helps in some way.
Neil Trigger - http://www.ghostlypublishing.co.uk - Ghostly Publishing - Children's Fantasy Books

#3 onlyican

  • Members
  • PipPipPip
  • Advanced Member
  • 921 posts
  • LocationHants - UK

Posted 29 August 2006 - 07:18 AM

Its called BB code. Javascript
Google BB code Tutorials
Tell me the problem, I will try tell you the solution

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users