PDA

View Full Version : Problem with the input of my BB code


Jero
08-04-2004, 03:54 PM
I want to place the BB code where the little 1px black verticle line is in the textarea, but it always adds it at the end of the message. This the page:

http://delta.foxhound.nl/post2.php?board=4

This is the javascript code that I got from some website:

function AddBBcode(BBcode) {
var BBcode;
var newMessage;
var oldMessage = document.post.message.value;
newMessage = oldMessage+BBcode;
document.post.message.value=newMessage;
document.post.message.focus();
return;

Thanks in advance!

And I have another question. How do I add the BB codes from the dropdown menu. Onclick doesn't seem to work there.

Willy Duitt
08-04-2004, 05:30 PM
Try using onchange as opposed to onclick....
Try searching Google using the keywords: textarea cursor position or looking here (http://www.webxpertz.net/forums/showthread.php?t=29942)...

.....Willy