runnerjp
asked on
trying to use an image to use as a textwrap but just refreshes page?
ok for my bbcode i want to enter images... so for this iv came up with this html/javascript (sown below)
but the problem is when ever i click on the image.. it enters it into the textbox but then refreshes the page :S how comes??
as can be seen by the code there is a toggle area to which you can view the smilies by clicking a button or not!
but the problem is when ever i click on the image.. it enters it into the textbox but then refreshes the page :S how comes??
as can be seen by the code there is a toggle area to which you can view the smilies by clicking a button or not!
function initialise() {
var element = document.getElementById('element-id');
if (element && element.style)
element.style.display = 'none';
}
function toggleDisplay(element) {
var style;
if (typeof element == 'string')
element = document.getElementById(element);
if (element && (style = element.style))
style.display = (style.display == 'none') ? '' : 'none';
}
if (!document.getElementById)
document.getElementById = function() {return null;};
<input type="button" value="Smilies" onclick="toggleDisplay('element-id');">
<div id="element-id" style="display: none;">
<INPUT TYPE="image" SRC="http://www.runningprofiles.com/emoticons/smiley.gif" name='smile' onclick='wrapText(document.getElementById('inputforum'),':',')');'>
</div>
Could you post code for the wrapText function?
ASKER
i did its hear
onclick='wrapText(document.getElementById('inputforum'),':',')');'>
No that's just the call to wrapText. I need the actual function like
function wrapText(){
//some code here
}
function wrapText(){
//some code here
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
thanks worked great!!!