Welcome, Guest
  • Author Topic: Javascript insert into textarea?  (Read 1731 times)

    MTsoul

    • Jr. Programmer
    • **
    • Posts: 61
    • haahaa
      • View Profile
      • - [skillzers] -
    Javascript insert into textarea?
    « on: 08/21/03, 21:15 »
    Hey, i'm making a forum, and now the bbcode part. How can i make a button insert a certain string into a textarea right at where the cursor is when clicked? eg. when posting on this forum, when i click the B, it inserts "[ b ][ / b ]"(spaced because of bbcode) into this textarea. However, when this was inserted, the cursor ended up after "[/b]". How can i also make the cursor end up in between the [ b ] and [ / b ]?
    - pinned

    vesa kortelainen

    • Global Moderator
    • Systems Administrator
    • *****
    • Posts: 3450
      • View Profile
    Re:Javascript insert into textarea?
    « Reply #1 on: 08/22/03, 04:59 »
    Would you try search from Google ?

    I found this : insert special character at cursor point in a field , Im not sure is that what you were lookin' ..

    Experts-exchange.com's JavaScript section is good place to look at and also Dynamic-Drive

    have nice weekend