jeskel
11-06-2004, 05:30 PM
Hi :)
first steps in the world of javascript.
You can guess that it's still a dark world to me. :)
Here is what I am trying to do.
I have a textarea and a little image (the common 'B' for Bold). I would like, as the title of this thread suggests, that when I click on the image, the highlighted texts become surrounded by these two custom bbCode: [ b ]text highlighted[ /b ] (extra spaces have been added so that vbulletin does not actually interpret the bbcode ;)).
Is that hard to achieve? Would someone show me how to do this?
That would be really nice.
Here is my actual code (just the fundations of the page). You will find the gif in question in the attachement part of this thread. I am looking forward to learning how to do this.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>playing with the textarea</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<script type=text/javascript>
</script>
</head>
<body>
<form name="replace" id="replace" action="" method="">
<img height=20 alt=Bold src="bold.gif" width=21>
<br />
<textarea name="test" rows="20" cols="35"></textarea>
<br />
<input type="submit" value="Submit" />
</form>
</body>
</html>
thanks in advance for your help :)
first steps in the world of javascript.
You can guess that it's still a dark world to me. :)
Here is what I am trying to do.
I have a textarea and a little image (the common 'B' for Bold). I would like, as the title of this thread suggests, that when I click on the image, the highlighted texts become surrounded by these two custom bbCode: [ b ]text highlighted[ /b ] (extra spaces have been added so that vbulletin does not actually interpret the bbcode ;)).
Is that hard to achieve? Would someone show me how to do this?
That would be really nice.
Here is my actual code (just the fundations of the page). You will find the gif in question in the attachement part of this thread. I am looking forward to learning how to do this.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>playing with the textarea</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<script type=text/javascript>
</script>
</head>
<body>
<form name="replace" id="replace" action="" method="">
<img height=20 alt=Bold src="bold.gif" width=21>
<br />
<textarea name="test" rows="20" cols="35"></textarea>
<br />
<input type="submit" value="Submit" />
</form>
</body>
</html>
thanks in advance for your help :)