Zelaron Gaming Forum  
Stats Arcade Portal Forum FAQ Community Calendar Today's Posts Search
Go Back   Zelaron Gaming Forum > The Zelaron Nexus > Science and Art > Tech Help

 
 
Thread Tools Display Modes

 
Anyone skilled enough to deal with this javascript inquiry?
Reply
Posted 2008-08-15, 05:43 AM
This is rather hard for me to figure out how to express, so I'm going to write out part of this.

I want to make it so when I highlight text between an area in a <textarea> box, and click a button, that the highlighted words will be wrapped with words, like the vB BB Codes.

I've yet to become really experienced with JavaScript, and nothing I've tried works at all. That includes that nothing appears.
 
Work List
疲れていますから 寝むってありますね。 むずかしいです。 また、ケーキ屋で ケーキを食べていました。

I've considered being a translator, but I dunno. It feels like a lot of work. If someone gets angry then I have to deal with it, you know? I'd rather just relax.

 
Speed Test
 
Favorite Anime/Manga
#01 Clannad ~After Story~
#02 Trigun {Maximum}
#03 Koi Kaze
#04 Berserk
#05 Outlaw Star
#06 Slayers
#07 Desert Punk
#08 Spirited Away
#09 Fullmetal Alchemist
#10 Shakugan no Shana
#11 Death Note
#12 FLCL
#13 Tokyo Magnitude 8.0
#14 Toradora
#15 Gunslinger Girl

 
Anime List
Old
Profile PM WWW Search
Goodlookinguy seldom sees opportunities until they cease to beGoodlookinguy seldom sees opportunities until they cease to beGoodlookinguy seldom sees opportunities until they cease to beGoodlookinguy seldom sees opportunities until they cease to be
 
 
Goodlookinguy
 



 
Reply
Posted 2008-08-15, 08:34 AM in reply to Goodlookinguy's post "Anyone skilled enough to deal with this..."
You need to make a variable which is the selection, and then set the variable to be itself and the tags. This might help:

theSelection = document.selection.createRange().text;
document.selection.createRange().text = "*" + theSelection + "*";


Obviously you replace the stars with the tag you want. Don't know if it works in anything other than IE, though, and I haven't a clue where it would go. Have fun with it.
Old
Profile PM WWW Search
Lenny simplifies with no grasp of the basicsLenny simplifies with no grasp of the basicsLenny simplifies with no grasp of the basicsLenny simplifies with no grasp of the basicsLenny simplifies with no grasp of the basicsLenny simplifies with no grasp of the basics
 
 
Lenny
 
 

Bookmarks

« Previous Thread | Next Thread »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules [Forum Rules]
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
BB coding help! - JavaScript as well included Goodlookinguy Tech Help 0 2007-08-28 04:43 PM
Vick signs Plea Deal.. D3V News and Events 16 2007-08-22 08:15 AM
Whats the deal? Sum Yung Guy General Gaming 15 2007-03-20 02:35 PM
Beckham signs deal with Los Angeles Galaxy Lenny General Discussion 16 2007-01-20 06:11 PM
good or bad deal? Exterminator D2 Marketplace 5 2003-03-20 04:48 PM


All times are GMT -6. The time now is 04:44 PM.
'Synthesis 2' vBulletin 3.x styles and 'x79' derivative
by WetWired the Unbound and Chruser
Copyright ©2002-2008 zelaron.com
Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
This site is best seen with your eyes open.