PDA

View Full Version : generating <size> with a selection



joon
11-08-2006, 08:59 AM
<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?

12345c
11-09-2006, 08:16 PM
You need to use croos-browser script for inserting of pseudotags.
For example, coomon script is here: http://javascript.aho.ru/example/JsPrimeryCode-90-en.htm - "Insertion of tags, codes of figures, citations"

joon
11-10-2006, 12:06 AM
You need to use croos-browser script for inserting of pseudotags.
For example, coomon script is here: http://javascript.aho.ru/example/JsPrimeryCode-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?

12345c
11-10-2006, 04:06 PM
But writing of PseudoTags with selections is more simplify thah whole script.

For this script such code will operate:


<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/JsPrimeryCode-90-en.htm ).

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

joon
11-11-2006, 07:19 AM
Thank you very much, 12345c who is from Moscow


- joon from Seoul -