tsclan
06-30-2004, 10:48 PM
ok just trying to get BBcode i think its called on my news admin script. As you all know it is uesed here for things like smiles and links. I have managed to get smilies working with this code which I found on the forums after a search
<script language="javascript">
var obj;
function insert(str){
if (obj){
obj.value+=str;
obj.focus();
}
}
</script>
</head>
<body>
<form name="">
<textarea name="t1" onfocus="obj=this"></textarea>
<textarea name="t2" onfocus="obj=this"></textarea>
<a href="javascript:insert(' :huh: ')"><img src="http://www.elitegnetwork.com/forums/html/emoticons/huh.gif" alt='smilie' border='0' /></a>
</form>
but what I didnt find while searching was the ability to have a link generation button where if u want to put in a link u press the button and a window pops up asking for the url and another for the url name
I have made the php so that it finds these tags (blahname (blah)) and inserts the approprite html in so the result when posted is a real html link.
So Now i am wanting to put in some javascript to help things become more user freindly
So in short how do you make a add link button like the one above while writing in the forums?
thanks
<script language="javascript">
var obj;
function insert(str){
if (obj){
obj.value+=str;
obj.focus();
}
}
</script>
</head>
<body>
<form name="">
<textarea name="t1" onfocus="obj=this"></textarea>
<textarea name="t2" onfocus="obj=this"></textarea>
<a href="javascript:insert(' :huh: ')"><img src="http://www.elitegnetwork.com/forums/html/emoticons/huh.gif" alt='smilie' border='0' /></a>
</form>
but what I didnt find while searching was the ability to have a link generation button where if u want to put in a link u press the button and a window pops up asking for the url and another for the url name
I have made the php so that it finds these tags (blahname (blah)) and inserts the approprite html in so the result when posted is a real html link.
So Now i am wanting to put in some javascript to help things become more user freindly
So in short how do you make a add link button like the one above while writing in the forums?
thanks