Jump to content

[SOLVED] Smiley buttons that insert : ) or ; ) when clicked to a text box.


lynxus

Recommended Posts

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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.