Looktrne Posted July 15, 2009 Share Posted July 15, 2009 this function works fine on one of my sites but won't work on a customers server function emoticon(text) { if (document.post.message.createTextRange && document.post.message.caretPos) { var caretPos = document.post.message.caretPos; caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == " " ? text + " " : text; document.post.message.focus(); } else { document.post.message.value += text; document.post.message.focus(); } } is there any settings server side that might prevent this from working? it enters a emoticon into a text field box... here is how it is called <script language="JavaScript" src="js/common.js"></script> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td class="headline" colspan="3">Send Message</td> </tr> <tr> <td width="9%" valign="top"> <p> </p> <table width="70" border="0" align="center" cellpadding="2" cellspacing="0" bgcolor="#FFCD9B"> <tr> <td colspan="3"><div align="center"><font size="1"><strong>Emoticons</strong></font></div></td> </tr> <tr> <td><img src="images/icon_smile.gif" width="15" height="15" onClick="emoticon(':-)');"></td> <td><img src="images/icon_biggrin.gif" width="15" height="15" onClick="emoticon(':-D');"></td> <td><img src="images/icon_sad.gif" width="15" height="15" onClick="emoticon(':-(');"></td> </tr> <tr> <td><img src="images/icon_eek.gif" width="15" height="15" onClick="emoticon(':shock:');"></td> <td><img src="images/icon_mad.gif" width="15" height="15" onClick="emoticon(':-X');"></td> <td><img src="images/icon_cool.gif" width="15" height="15" onClick="emoticon('B-)');"></td> </tr> <tr> <td><img src="images/icon_razz.gif" width="15" height="15" onClick="emoticon(':-P');"></td> <td><img src="images/icon_wink.gif" width="15" height="15" onClick="emoticon(';-)');"></td> <td><img src="images/icon_surprised.gif" width="15" height="15" onClick="emoticon(':-O');"></td> </tr> </table> </td> <td width="91%"><table width="100%" border="0" cellspacing="4" cellpadding="4" background="tn_811.jpg" bgcolor="#FFFFFF" align=center> <table> {FORM_ERRORS} <tr> <td> <form action="index.php?page=send_message&action=send&profile_id=464" method=POST name="post"> <table> <tr> <td> <tr> <td>To:</td> <td> {SEND_MESSAGE_CONTENT} </td> </tr> <tr> <td>Subject:</td> <td><input type="text" name="subject" size="50" maxlength="50" value="{MSG_SUBJECT}" {INPUT_DISABLED}></td> </tr> <tr> <td valign=top>Message:</td> <td><textarea name="message" rows="7" cols="40" {INPUT_DISABLED}>{MSG_BODY}</textarea></td> </tr> <tr> <td colspan=2 align=right><input name="submit" type="submit" value="Send Message" {INPUT_DISABLED}></td> </tr> </table> </form></td> </tr> </table> <br> </td> </tr> </table> any help with why this may not be working please let me know Paul Quote Link to comment Share on other sites More sharing options...
trq Posted July 16, 2009 Share Posted July 16, 2009 Considering that Javascript is executed by the browser not the server, you can rule that idea out of the question. You might want to describe what the problem is. Quote Link to comment Share on other sites More sharing options...
Looktrne Posted July 17, 2009 Author Share Posted July 17, 2009 when I use this function on my site it works I click on a smiley face and it plants the text " " into the text area of the message when I click on the smiley face on my customers site with the same code. it does nothing nothing is put into the text box. I also get an error object expected in internet explorer Paul Quote Link to comment Share on other sites More sharing options...
Looktrne Posted July 17, 2009 Author Share Posted July 17, 2009 I got it figured out some of the code had errors it somehow was corrupted on the other site thanks anyway Paul Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.