tags:

views:

50

answers:

2

Hello everyone. I have a shoutbox/ chatroom feature on my site. I have a list of online users on the left. I plan on making a button for each user that when clicked, puts their username into the typing area on the shoutbox.

Whats the best way to go about doing this?

+1  A: 

You want it so when you click their name, it's appended to a text field? You can just do:

<span onClick="document.getElementById('shoutbox').text += 'test-username';">test-username</span>
Michael Mrozek
A: 

Bind the links to JavaScript. PHP can't help you here.

Jan Kuboschek