SitePoint Sponsor

User Tag List

Results 1 to 4 of 4

Hybrid View

  1. #1
    SitePoint Addict WebMasterAJ's Avatar
    Join Date
    Aug 2000
    Location
    Miami
    Posts
    335
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Add Data Into Text Area... Please help

    Hello all!

    Can someone please tell me how I can make something similar to whats above the text area when someone replies or makes a new thread?

    The writers for my site don't know ANYTHING about HTML, and making something like the "http://" button above would be a huge help!

    I've done some searching, and only found ways to make bold and underline... etc.

    Anyways, can someone please help me out?

    Thanks!
    Andrew Tatum
    FinHeaven & Co - Get Drenched With Finformation
    The FinHeaven & Co Forums

  2. #2
    What? Maelstrom's Avatar
    Join Date
    Oct 2001
    Location
    Whistler BC originally from Guelph Ontario
    Posts
    2,175
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I am not quite sure what you are asking. Well I am kind of sure. Are you retrieving this data from a database or just using javascript. I assume if it is similar to a response button than it is some sort of database and server language. That is how this site does it.

    Maelstrom Personal - Apparition Visions
    Development - PhP || Mysql || Zend || Devshed
    Unix - FreeBSD || FreeBsdForums || Man Pages
    They made me a sitepoint Mentor - Feel free to PM me or Email me and I will see if I can help.

  3. #3
    SitePoint Member
    Join Date
    Mar 2002
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    that is a pretty neat feature--it's all done with javascript, though what converts that code in to real html is a script running on the server. for in-house use you could just use html straight, probably, instead of using the vB Code.

    you can get an idea how sitepoint does it by viewing the source on a reply page and checking out http://www.sitepointforums.com/vbcode.js and http://www.sitepointforums.com/vbcode_language.js

    This is a fairly advanced little script, though, so if you don't know what you're doing, expect to be confused.

    -wg <><

  4. #4
    Perl/Mason Guru Flawless_koder's Avatar
    Join Date
    Feb 2002
    Location
    Gatwick, UK
    Posts
    1,206
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Depends really on how you want the href to be shown.
    The document.createElement('A'); method would work quite well if you wanted an instant clientside reflection of the href:

    Code:
    function create_link(){
     var hrf=prompt('Please type your link in here:','www.worldwideweb.com');
     var a=document.createElement('A');
     a.href=href;
     a.target='_blank';
     a.style.text-decoration='none'; // No underline
     a.style.color='#660000';
     /* The following line would probably NOT work,
        but it might be worth a try, since if it does
        the effect would be very unique.
        As far as i'm aware the textbox element does NOT
        have the ability to spawn children
     document.all.textbox.appendChild(a);
        This is the end of unlikely code!             */
     document.all.showing_divider.appendChild(a);
     // The above would work though
     }
    The other thing you might want to do is manually create a link and add it as text to a textbox so that you can then save it to the disk quickly with a server side language. ie: you literally put <a href='x' target='_blank'> into the textbox, and it's saved directly into the source by the server side lanugage.

    The third approach is to have a server language parse the text box for something like :href[www.sitepointforums.com].

    I don't see much point in doing it this way, but some people might want to for convienience of browser compatibility ( i can't stand NN anyway ;-) )

    Hope this adds something to the discussion.

    Flawless
    ---=| If you're going to buy a pet - get a Shetland Giraffe |=---


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
  •