SitePoint Sponsor |
|
User Tag List
Results 1 to 5 of 5
Thread: just two text area questions...
Hybrid View
-
Aug 13, 2002, 16:27 #1
- Join Date
- Jun 2002
- Location
- Huntsville Alabama
- Posts
- 394
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
just two text area questions...
ok just two questions on the subject of text areas.
first:
is there a way to figure out where the cursor is in a text area? like in these forms when you're posting a new topic you type somthing in like "hello". then right after that you type in "person". you click between the two words and click on the button labeled "B" to insert bold text. the bold text appears AFTER THE WORD "PERSON". now how would you make it where it inserts the bolded text BETWEEN the two words?
second:
when you highlight text in a text area, is there a way to figure out what text is highlighted?
thanks in advance...[ metabahn ] : changing the course of the web.
-
Aug 13, 2002, 17:28 #2
- Join Date
- Aug 2001
- Location
- London
- Posts
- 2,475
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
something like this will do that
PHP Code:function bold()
{
document.execCommand('bold', false, null);
}
-
Aug 13, 2002, 18:24 #3
- Join Date
- Jun 2002
- Location
- Huntsville Alabama
- Posts
- 394
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
works great! do you know where i can find a list of all the execCommands? thanks!
[ metabahn ] : changing the course of the web.
-
Aug 13, 2002, 18:43 #4
- Join Date
- Jun 2002
- Location
- Huntsville Alabama
- Posts
- 394
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
cancel that last order.
found the list on the microsoft site: http://msdn.microsoft.com/library/de...xeccommand.asp
thanks again for your help![ metabahn ] : changing the course of the web.
-
Aug 13, 2002, 18:48 #5
- Join Date
- Aug 2001
- Location
- London
- Posts
- 2,475
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
No sry, but the ones i do know that work are:
ForeColor
BackColor
Bold
Italic
Copy
Cut
Paste
Print
just swap that in the appropriate place, im sure there are more but there off the top of my head.
Bookmarks