Forum Moderators: coopster

Message Too Old, No Replies

Insert text into form

         

bysonary

9:17 pm on Apr 9, 2007 (gmt 0)

10+ Year Member



Hello

I have a written bbcode function if you like, one thing i would like to do is create images/text links that will insert certain strings into the textarea.

for example things like [ b ][ /b ] etc etc and when it does insert this bbcode it also highlights it in the textarea if possible, oh and it must insert it into the text area where the cursor currently sits.

I'm not sure if this is in the righr section but I know all the people in this forum (PHP) are clued up and might know the answer rather simple HTML types (no offence - lol)

can anyone tell me how to do this wonderful action? I suspect javascript but maybe its doable with php, or maybe just HTML, anyone care to help?

Chris

jatar_k

9:19 pm on Apr 9, 2007 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



javascript is the way to go, for php to do it you would have to send it back to the server, what you need is a client side language, which javascript is

I would suggest looking at phpbb, or similar, and see what they do. You could use their code as a model.

bysonary

9:21 pm on Apr 9, 2007 (gmt 0)

10+ Year Member



cheers mate, ill have a look