SitePoint Sponsor

User Tag List

Results 1 to 5 of 5

Hybrid View

  1. #1
    webality...dunno what it means bcp_2005's Avatar
    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.

  2. #2
    Currently Occupied; Till Sunda Andrew-J2000's Avatar
    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'falsenull); 


  3. #3
    webality...dunno what it means bcp_2005's Avatar
    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.

  4. #4
    webality...dunno what it means bcp_2005's Avatar
    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.

  5. #5
    Currently Occupied; Till Sunda Andrew-J2000's Avatar
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •