SitePoint Sponsor |
|
User Tag List
Results 1 to 4 of 4
Hybrid View
-
Mar 29, 2002, 17:44 #1
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!
-
Mar 29, 2002, 22:37 #2
- 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.
-
Mar 30, 2002, 00:13 #3
- 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 <><
-
Mar 30, 2002, 17:04 #4
- 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 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