View Full Version : Auto Text Change Depending on Symbol
Anayet
July 10th, 2001, 10:32
Is it possible to add some kind of HTML or somthing to CSS or just HTML pages, so that when you enter certain symbols, those symbols will change to text eg.
When you enter:
: )
the symbol will change to:
http://www.pic.com/smile.gif
Is this possible?
If so how?
Thank You in advance
Sorry edited it, finally came out properly.
lucifer
July 10th, 2001, 10:35
not sure what you mean
Anayet
July 10th, 2001, 10:43
Edited the text. Kept on changing automatically :D
Can anybody help?
Thanks
gyrbo
July 10th, 2001, 10:50
Well, if you run a javascript that checks for that in a textarea. Not sure about the code though
Anayet
July 10th, 2001, 11:05
Anybody know the code?????
lucifer
July 10th, 2001, 11:26
still confussed
to do something like on this board is very easy just use regular expressions. To do it dynamically on a HTML page, as you type in the box. would be near to imposible I think or at least a real pain (you could have all sorts of layers with faces that hovered over the textbox but you are talking silly). You could do it using flash though.
or do you mean like the smilies click on them and you get text added to the box
Anayet
July 10th, 2001, 11:33
adding smilies via clicking on them and adding them to text boxs, would be ok, if you could tell me how to do it.
With the first one I asked, I would have made symbols like :smile: or :cry: so they would not have become mixed up, thats why I am stilll interested in this, if anybody knows how to do it.
thanks
lucifer
July 10th, 2001, 13:02
still not sure what you mean
this?
<html>
<head>
<title>Some Crap</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<form name="form1" method="post" action="">
<textarea name="text"></textarea>
<a href="#" onclick="addtext('fred');return 0">fred</a> <a href="#" onclick="addtext('jim');return 0">jim</a> <a href="#" onclick="addtext('joe');return 0">joe</a>
<script language="JavaScript">
function addtext(str){
document.forms[0].text.value=document.forms[0].text.value + str;
}
</script>
</form>
</body>
</html>
Anayet
July 11th, 2001, 05:54
Thanks Lucifer, that will do very nicely.
I have one more question though.
If there was already a form box, and I couldn't change it, and it was called "post message"
How would I edit the html of the above script so that when I click on the auto-insertions, they'll be inserted into "that" form box.
Many Thanks
lucifer
July 11th, 2001, 06:28
use
document.forms[0].elements[x].value
where x is the position of the element in the form
first element x=0
second element x=1
etc.
Anayet
July 11th, 2001, 06:44
Thanks Lucifer
Anayet
July 11th, 2001, 10:19
One more thing, for anybody who uses EZBoard, can this script be entered in an EZBoard????
thanks
lucifer
July 11th, 2001, 10:26
You can add it I'm sure
the onclick="...." can be put in lots of tags
eg <IMG> <A> <INPUT type="button">
make sure you return 0 at the end if it's a link or submit button, to stop it dinig it's stuff (taking you to another page)
Anayet
July 11th, 2001, 11:29
Yehhhhhhh!!!
DID IT.
Thank You Lucifer, for all your help, I've been wanting something like this for ages, and thanks to you, it works.
Thank you, Thank you
and once again, thank you:D
Powered by vBulletin® Version 4.1.7 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.