SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Hybrid View

  1. #1
    SitePoint Enthusiast
    Join Date
    Jul 2002
    Location
    Switzerland
    Posts
    45
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    putting b tags into textarea

    ok I have this script. I'm not very good at javascript. but I need to make that if I click the BOLD image it adds the tags [b] into the textarea. It is not working so far. I guess the call of the function is not right. Can you help me? thanks.


    Code:
    <script language="JavaScript1.2" type="text/javascript">
    	function bold() {
    
    	AddTxt="";
    
    	AddText(AddTxt);
    
    }
     </script>
    </head>
    
    <body>
    <script language="JavaScript1.2" type="text/javascript">
            <!--
            if((navigator.appName == "Netscape" && navigator.appVersion.charAt(0) >= 4) || (navigator.appName == "Microsoft Internet Explorer" && navigator.appVersion.charAt(0) >= 4) || (navigator.appName == "Opera" && navigator.appVersion.charAt(0) >= 4) || (navigator.appName == "WebTV Plus Receiver" && navigator.appVersion.charAt(0) >= 3)) {
              document.write("<a href=javascript:bold()><img src='$imagesdir/bold.gif' align=bottom width=23 height=22 alt='$txt{'253'}' border=0></a>");
              document.write("<a href=javascript:italicize()><img src='$imagesdir/italicize.gif' align=bottom width=23 height=22 alt='$txt{'254'}' border='0'></a>");
              
            }
            else { document.write("<font size='1'>$txt{'215'}</font>"); }
            //-->
            </script>
    		
    		
    		<textarea name="message" rows="25" cols="110" wrap="soft" ONCLICK="javascript:storeCaret(this);" ONKEYUP="javascript:storeCaret(this);" ONCHANGE="javascript:storeCaret(this);" onMouseOver="this.focus()" tabindex="4">$message</textarea>
    Last edited by freakysid; Nov 19, 2002 at 19:17.

  2. #2
    Web-coding NINJA! silver trophy beetle's Avatar
    Join Date
    Jul 2002
    Location
    Dallas, TX
    Posts
    2,900
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Where is your AddText() function?
    beetle a.k.a. Peter Bailey
    blogs: php | prophp | security | design | zen | software
    refs: dhtml | gecko | prototype | phpdocs | unicode | charsets
    tools: ide | ftp | regex | ffdev





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
  •