<Script language = "JavaScript" src = "JS/settags. js"> </SCRIPT> function apptag (tagcode)
{
Document. postmessage. Message. Value + = tagcode;
} Function inserttag (tagbegin, tagend)
{
If (document. Selection) & (document. selection. type = "text ")){
VaR range = Document. selection. createRange ();
VaR ch_text = range. text;
Range. Text = tagbegin + ch_text + tagend;
}
Else
{
Document. postmessage. Message. value = tagbegin + document. postmessage. Message. Value + tagend;
Document. postmessage. Message. Focus ();
}
} </SCRIPT>
Call:
Icon button for performing the operation: <A href = "javascript: apptag ('[imgface1]')"> </a> <a href =" javascript: inserttag ('[B]', '[/B]') "> </a>
[Imgface1], [B], [/B] Are the text to be inserted var range = Document. selection. createRange ();
VaR ch_text = range. text;
This is the text box for operations on the selected text box: <asp: textbox id = "message" runat = "server" maxlength = "100" textmode = "multiline" rows = "15" width = "100%"/>