EKsparky
02-08-2008, 12:21 PM
Hi
I am writing my own mini cms mostly in php
I writtern my own news with bbcode type links
I want to ba able to add text to my form when bbcode images are clicked
I.E click B and [b][\b] is added to form (just like this text box i am posting in now)
now i found a snippet of code that does this but my problem is using it for all my images B I U img etc etc i guess i need to add id some how
<html>
<head>
<title></title>
<script type="text/javascript" language="javascript"><!--
function ChgText()
{
var MyElement = document.getElementById("MyTextBox");
MyElement.value = "[b][\b]!";
return true;
}
//--></script>
</head>
<body>
<br><br>
<center>
<img src="my_image.gif" alt="Click Me!" onClick="ChgText()" />
<br><br><br>
<input type="text" size="35" id="MyTextBox" />
</center>
</body>
</html>
Thanks
I am writing my own mini cms mostly in php
I writtern my own news with bbcode type links
I want to ba able to add text to my form when bbcode images are clicked
I.E click B and [b][\b] is added to form (just like this text box i am posting in now)
now i found a snippet of code that does this but my problem is using it for all my images B I U img etc etc i guess i need to add id some how
<html>
<head>
<title></title>
<script type="text/javascript" language="javascript"><!--
function ChgText()
{
var MyElement = document.getElementById("MyTextBox");
MyElement.value = "[b][\b]!";
return true;
}
//--></script>
</head>
<body>
<br><br>
<center>
<img src="my_image.gif" alt="Click Me!" onClick="ChgText()" />
<br><br><br>
<input type="text" size="35" id="MyTextBox" />
</center>
</body>
</html>
Thanks