Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2

Thread: bb buttons

  1. #1
    Regular Coder
    Join Date
    Nov 2006
    Posts
    601
    Thanks
    1
    Thanked 2 Times in 2 Posts

    bb buttons

    i have write some bbcode but im struggling on adding the buttons like bold and italic to insert the [ code ] texts... how would i do this?

  • #2
    Regular Coder ohgod's Avatar
    Join Date
    Jun 2008
    Location
    Ohio
    Posts
    579
    Thanks
    6
    Thanked 69 Times in 69 Posts
    add the button in the template. make it so when you click it checks for selected text in your textarea and then replaces the text with the text wrapped in your tags. if no selected text append it to the bottom of the text area value.

    google "js get selected text"... there are tut's to show how to deal with it cross browser.


  •  

    Posting Permissions

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