Results 1 to 5 of 5

Thread: generating <size> with a selection

  1. #1
    Join Date
    Apr 2005
    Posts
    25
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default generating <size> with a selection

    Code:
    <form>
    
    <select name='size'>   
       <option value='size1'>size1</option>
       <option value='size2'>size2</option>
       <option value='size3'>size3</option>
       <option value='size4'>size4</option>
    </select><br>
    
    <textArea name='textArea' style='width:500;height:150'>
    target text
    </textArea>
    
    </form>
    I have a selection and textArea like the above.

    I like to make it like the following.

    (1) A user puts the cursur in front of target text with his or her mouse.
    (2) He or she drags the cursur to the end of target text.
    (3) He or she selects size3 using the selection box.

    Then,

    "target text" becomes "<size3>target text</size3>."

    Can I do it with your help?

  2. #2
    Join Date
    Dec 2005
    Location
    Moscow, Russia
    Posts
    39
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    You need to use croos-browser script for inserting of pseudotags.
    For example, coomon script is here: http://javascript.aho.ru/example/JsP...Code-90-en.htm - "Insertion of tags, codes of figures, citations"

  3. #3
    Join Date
    Apr 2005
    Posts
    25
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by 12345c
    You need to use croos-browser script for inserting of pseudotags.
    For example, coomon script is here: http://javascript.aho.ru/example/JsP...Code-90-en.htm - "Insertion of tags, codes of figures, citations"
    Thank you for the link.

    But the link has insertion of PseudoTags with buttons.

    I like to find insertion of PseudoTags with selections.

    Any code or URL relating to insertion of PseudoTags with selections, please?
    Last edited by joon; 11-10-2006 at 12:11 AM.

  4. #4
    Join Date
    Dec 2005
    Location
    Moscow, Russia
    Posts
    39
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    But writing of PseudoTags with selections is more simplify thah whole script.

    For this script such code will operate:

    Code:
    <select onchange=insTag(this.options[selectedIndex].value);this.selectedIndex=0;>
      <option value=nocolor style=color:gray>Select</option>
      <option value=red style=color:red>color1</option>
      <option value=green style=color:green>color2</option>
      <option value=blue style=color:blue>color3</option>
    </select>
    I was insert this select tag in the example page ( http://javascript.aho.ru/example/JsP...Code-90-en.htm ).

    This script can be adjusted to another form of tags - angular brackets, for example. Or <color=red></color>.

  5. #5
    Join Date
    Apr 2005
    Posts
    25
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thank you very much, 12345c who is from Moscow


    - joon from Seoul -

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
  •