[help]Tag bbcodes ?

Started on the old forum in April 2012 · view the original in the archive · old links redirect here

4 replies · 451 views · started 14 years ago · 1 min read

3 participants
12345xmen Developer · 239 posts #1

hi am want to put this coding like

when people make new topic then they easly choose bbcode just on click on then same like in this forum

i use ulkoi forum and i dnt have idea for that .......

i want for some bbcode so help me how i put this !

i got this code

<a onClick="addSmiley('[b][/b]')"><img src='images/bold.gif'></a> <a onClick="addSmiley('[i][/i]')"><img src='images/italic.gif'></a> <a onClick="addSmiley('[u][/u]')"><img src='images/underline.gif'></a> <a onClick="addSmiley('[img][/img]')"><img src='images/img.gif'></a> <a onClick="addSmiley('[url][/url]')"><img src='images/url.gif'></a> <a onClick="addSmiley('[mail][/mail]')"><img src='images/mail.gif'></a><br>

and this javascript code

<script language="JavaScript" type="text/javascript">
function addSmiley(textToAdd)
{
document.form.post.value += textToAdd;document.form.post.focus();
}
</script>

but still not click on my localhost !

now how make this code clikable its unclickable !

something else Fellow · 2,296 posts #2

nothing wrong with your code

the problem is in your forms

12345xmen Developer · 239 posts #3
<table class="maintable">
    <tr class="headline"><td>New Topic</td></tr>
    <tr class="forumrow"><td>
    <form action="newtopic.php?fid=<?php echo $forumid.$s2;?>" enctype="multipart/form-data" method="post" name="form">
	<br/>
	<table class="maintable" style="width:500px;">
	<tr><td><b>Topic</b>: </td><td> <input type="text" name="topictitle" style="width:450px;" /> </td></tr>
	<tr><td valign="top"><b>Message</b>: </td><td> <textarea name="description" style="width:450px;height:200px;" ></textarea> 
	<br/><br/><a onClick="addSmiley('[b][/b]')"><img src='images/bold.gif'></a> <a onClick="addSmiley('[i][/i]')"><img src='images/italic.gif'></a> <a onClick="addSmiley('[u][/u]')"><img src='images/underline.gif'></a> <a onClick="addSmiley('[img][/img]')"><img src='images/img.gif'></a> <a onClick="addSmiley('[url][/url]')"><img src='images/url.gif'></a> <a onClick="addSmiley('[mail][/mail]')"><img src='images/mail.gif'></a><br>
<script language="JavaScript" type="text/javascript">
function addSmiley(textToAdd)
{
hi;
}
</script>
</td></tr></table></center></td></tr></table>

here is my form code now tell me wher is wrong !

something else Fellow · 2,296 posts #4

your form needs "form" as a name eg:

<form name="form"

and then change the word "post" in your javascript to "description" as this is the name of your textarea 🙂

Added after 6 minutes:

also im not sure if onClick works with a <a> so you might have to change it to:

<a href="javascript:addSmiley('[b][/b]')"><img src='images/bold.gif'></a>
icedroplet1987 Senior · 258 posts #5

he is already having formname as topicform. he is just missing to use it in js.. it should be like

function addSmiley(textToAdd)

{

document.topicform.description.value += textToAdd;document.topicform.description.focus();

}

and yes, on click isnt working as he is using defined text on it. not using function. .. thnks s/e.. x-men is my oldest friend and partner. so working with him:)

Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close