[help]Tag bbcodes ?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    [help]Tag bbcodes ?

    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

    PHP 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

    PHP 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 !
    Last edited by 12345xmen; 07.04.12, 05:15.

    #2
    nothing wrong with your code

    the problem is in your forms

    Comment


      #3
      PHP Code:
      <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 !

      Comment


        #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:
        PHP Code:
        <a href="javascript:addSmiley('[b][/b]')"><img src='images/bold.gif'></a
        Last edited by something else; 07.04.12, 12:48.

        Comment


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

          Code:
          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

          Comment

          Working...
          X