forget the first one, this is betterhere is an example with 2 textareas
<html><head><script type='text/javascript'>function addBB (text, target){ document.getElementById(target).value+=text;}</script></head><body><form action="somefile.php" id="form1"><input type='button' value='Italic' onclick="addBB('[i]ITALIC_TEXT[/i] ', 'txt');"><input type='button' value='bold' onclick="addBB('[b]BOLD_TEXT[/b] ', 'txt');"><input type='button' value='underline' onclick="addBB('[u]UNDERLINE_TEXT[/u] ', 'txt');"><input type='button' value='url' onclick="addBB('[url=URL_TO_GO_TO]TEXT_DISPLAYED[/url] ', 'txt');"><input type='button' value='color' onclick="addBB('[color=COLOR_YOU_WANT]COLORED_TEXT[/color] ', 'txt');"><input type='button' value='image' onclick="addBB('[img=IMAGE_PATH] ', 'txt');"><input type='button' value='align' onclick="addBB('[align=LEFT/RIGHT/CENTER]CONTENT_TO_BE_ALIGNED[/align] ', 'txt');"><br><textarea cols='80' rows='10' id='txt' name='txt'></textarea><br> <br><input type='button' value='Italic' onclick="addBB('[i]ITALIC_TEXT[/i] ', 'txt2');"><input type='button' value='bold' onclick="addBB('[b]BOLD_TEXT[/b] ', 'txt2');"><input type='button' value='underline' onclick="addBB('[u]UNDERLINE_TEXT[/u] ', 'txt2');"><input type='button' value='url' onclick="addBB('[url=URL_TO_GO_TO]TEXT_DISPLAYED[/url] ', 'txt2');"><input type='button' value='color' onclick="addBB('[color=COLOR_YOU_WANT]COLORED_TEXT[/color] ', 'txt2');"><input type='button' value='image' onclick="addBB('[img=IMAGE_PATH] ', 'txt2');"><input type='button' value='align' onclick="addBB('[align=LEFT/RIGHT/CENTER]CONTENT_TO_BE_ALIGNED[/align] ', 'txt2');"><br><textarea cols='80' rows='10' id='txt2' name='txt'></textarea><br><input type='submit' value='save'></form></body></html>
when you call the addBB function, the first argument is the text which you want to add when button is clicked and the second argument is the target textarealike this:addBB('text_to_display', 'target_textarea')you can add as much textareas you want :)btw. this doesn't have anything to do with php, somebody move this thread to javascript forum