Results 1 to 5 of 5

Hybrid View

  1. #1
    Join Date
    Sep 2002
    Location
    az
    Posts
    168

    Ye olde javascript!

    Ok, i have this code to insert smilies into a message area box...
    PHP Code:
    <script language="javascript" src="smilie.js">
    </script>
    <form name="comment" method="post" action="">
    <textarea name="message" cols="30" rows="10" class="input"></textarea>
    <table border="0" cellpadding="2" cellspacing="0" class="input">
    <tr align="center" valign="middle"> 
    <td width="4"><img src="http://www.flashstand.com/comments/lol.gif" onMouseOver="this.style.cursor='hand';" onClick="smilie(':lol:');" alt="LOL"> </td>
    <td width="4"><img src="http://www.flashstand.com/comments/cheesygrin.gif" onMouseOver="this.style.cursor='hand';" onClick="smilie(':cheesy:');" alt="Cheesy grin"> </td>
    <td width="4"><img src="http://www.flashstand.com/comments/biggrin.gif" onMouseOver="this.style.cursor='hand';" onClick="smilie(':D');" alt="Big grin"> </td>
    <td width="4"><img src="http://www.flashstand.com/comments/razz.gif" onMouseOver="this.style.cursor='hand';" onClick="smilie(':P');" alt="Razz!"> </td>
    </tr>

    <tr align="center" valign="middle"> 
    <td><img src="http://www.flashstand.com/comments/wink.gif" onMouseOver="this.style.cursor='hand';" onClick="smilie(';)');" alt="Wink"> </td>
    <td><img src="http://www.flashstand.com/comments/smile.gif" onMouseOver="this.style.cursor='hand';" onClick="smilie(':)');" alt="Smile"></td>
    <td><img src="http://www.flashstand.com/comments/cool.gif" onMouseOver="this.style.cursor='hand';" onClick="smilie('8)');" alt="Cool"> </td>
    <td><img src="http://www.flashstand.com/comments/blush.gif" onMouseOver="this.style.cursor='hand';" onClick="smilie(':blush:');" alt="Blush"> </td>
    </tr>

    <tr align="center" valign="middle"> 
    <td><img src="http://www.flashstand.com/comments/confused.gif" onMouseOver="this.style.cursor='hand';" onClick="smilie(':confused:');" alt="Confused"> </td>
    <td><img src="http://www.flashstand.com/comments/eek.gif" onMouseOver="this.style.cursor='hand';" onClick="smilie(':eek:');" alt="EEK!"> </td>
    <td><img src="http://www.flashstand.com/comments/rolleyes.gif" onMouseOver="this.style.cursor='hand';" onClick="smilie(':rolleyes:');" alt="Roll Eyes"> </td>
    <td><img src="http://www.flashstand.com/comments/sad.gif" onMouseOver="this.style.cursor='hand';" onClick="smilie(':(');" alt="Sad"> </td>
    </tr>

    <tr align="center" valign="middle"> 
    <td><img src="http://www.flashstand.com/comments/cry.gif" onMouseOver="this.style.cursor='hand';" onClick="smilie(':cry:');" alt="Cry"> </td>
    <td><img src="http://www.flashstand.com/comments/mad.gif" onMouseOver="this.style.cursor='hand';" onClick="smilie(':mad:');" alt="Mad"> </td>
    <td><img src="http://www.flashstand.com/comments/evil.gif" onMouseOver="this.style.cursor='hand';" onClick="smilie(':evil:');" alt="Evil"> </td>
    <td><img src="http://www.flashstand.com/comments/question.gif" onMouseOver="this.style.cursor='hand';" onClick="smilie(':?:');" alt="Question"> </td>
    </tr>
    </table>
    </body>
    </html> 
    And then on smilie.js I have
    PHP Code:
    function smilie(thesmilie) {
    // inserts smilie text

        
    document.comment.message.value += thesmilie+" ";
        
    document.comment.message.focus();
                         }

    But that doesnt seem to work, whats wrong with my code?

    That did come out a little wrid because vb is trying to post some of the images cause im using some of the same bb code commands, try to work around it lol
    Last edited by brcolow; 10-17-2002 at 01:59 AM.

  2. #2
    function smilie(thesmilie) {
    // inserts smilie text

    document.comment.message.value += thesmilie+" ";
    document.comment.message.focus();
    } // this "}" is unwanted
    }

    and the code following:
    --------------------------------------------------
    <td width="4"><img src="http://www.flashstand.com/comments/biggrin.gif" onMouseOver="this.style.cursor='hand';" onClick="smilie('<img src="images/smilies/biggrin.gif" border="0" alt="">');" alt="Big grin"> </td>
    --------------------------------------------------

    should be this following:
    --------------------------------------------------
    <td width="4"><img src="http://www.flashstand.com/comments/biggrin.gif" onMouseOver="this.style.cursor='hand';" onClick="smilie('<img src=\'images/smilies/biggrin.gif\' border=\'0\' alt=\'\'>');" alt="Big grin"> </td>
    --------------------------------------------------

    as so on ...

    try it.
    Life's Base on your heart.

  3. #3
    Join Date
    Sep 2002
    Location
    az
    Posts
    168
    Dude, thanks so much man, u r my god check out what u help me with, www.flashstand.com/comments/comment.php nice huh?

  4. #4
    Join Date
    Aug 2002
    Location
    London, UK
    Posts
    9,039
    welcome to the forum [D.K]
    Matt Wallis
    United Communications Limited
    High Performance Shared & Reseller | Managed VPS Cloud | Managed Dedicated
    UK www.unitedhosting.co.uk | US www.unitedhosting.com | Since 1998.

  5. #5
    Originally posted by UH-Matt
    welcome to the forum [D.K]
    :p


    Be Moved to

    Life's Base on your heart.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •