Results 1 to 5 of 5
Thread: Ye olde javascript!
Hybrid View
-
10-17-2002, 01:46 AM #1WHT Addict
- 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>
PHP Code:function smilie(thesmilie) {
// inserts smilie text
document.comment.message.value += thesmilie+" ";
document.comment.message.focus();
}
}
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 lolLast edited by brcolow; 10-17-2002 at 01:59 AM.
-
10-17-2002, 03:59 AM #2Newbie
- Join Date
- Oct 2002
- Posts
- 9
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.
-
10-17-2002, 04:13 AM #3WHT Addict
- 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?
-
10-17-2002, 08:35 AM #4Web Hosting Master
- 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.
-
10-17-2002, 10:05 PM #5Newbie
- Join Date
- Oct 2002
- Posts
- 9
Originally posted by UH-Matt
welcome to the forum [D.K]
Be Moved to
Life's Base on your heart.