SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    Get my greedy down dotJoon's Avatar
    Join Date
    Apr 2003
    Location
    daejeon, South Korea
    Posts
    2,223
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Automatically generating color tags(<color="red">,</color>)

    Code:
    code
    
    <form action='action.cfm' method='post'>
    
    <select name='color'>
    <option value='colors'>colors</option>
    <option value='green'>green</option>
    <option value='blue'>blue</option>
    <option value='red'>red</option>
    </select>
    
    <textarea name='box'></textarea>
    
    
    </form>
    Let's suppose I have the above code.
    If a user opens the file above in browser, it will show a color selection box, and a textarea box.
    I like to make it like the following.

    If a user writes the following sentence

    "I like to write this sentence in red." into the textarea, and drags his or her mouse from "I like ~" to "~sentence." and selects "red" in the selection box, then
    <color="red"> and </color> are automatically generated and surround the sentence.

    So it will look like the following.

    <color="red">I like to write this sentence in red.</color>

    Can I make it in javascript with your help? How?

  2. #2


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
  •