lynxus Posted September 3, 2009 Share Posted September 3, 2009 Hi guys, I have a form: <input name="message" type="text" class="texta" id="message" style="width:100%" onFocus="this.value=''" onKeyPress="handleEnter(this, event)" value="Type your message here , Then press Return/Enter." /> I also have a bunch of smiley images. ( like above in the phpfreaks reply form ) How can i get it so if someone clicks an image, It will update the text field in my code with the required chars, ie: if someone clicked the smile icon it would append : ) at the end of the text field ( without overwriting what migth already be in it ) Any ideas? My javascript is very very flaky. I would assume it would be something like. document.message = document.message + ": )"; Or along those lines.. How its actualy coded i have no clue or called. Thanks Graham Quote Link to comment Share on other sites More sharing options...
lynxus Posted September 3, 2009 Author Share Posted September 3, 2009 Ah ha , figured it out <script type="text/javascript" language="javascript"><!-- function ChgText(code) { var message = document.getElementById("message"); message.value = message.value + code; message.focus(); } //--></script> Ty all 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.